3 #define PY_SSIZE_T_CLEAN 6 #error Python headers needed to compile C extensions, please install development version of Python. 7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) 8 #error Cython requires Python 2.6+ or Python 3.3+. 10 #define CYTHON_ABI "0_29_16" 11 #define CYTHON_HEX_VERSION 0x001D10F0 12 #define CYTHON_FUTURE_DIVISION 0 15 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) 17 #if !defined(WIN32) && !defined(MS_WINDOWS) 29 #define DL_IMPORT(t) t 32 #define DL_EXPORT(t) t 35 #ifndef HAVE_LONG_LONG 36 #if PY_VERSION_HEX >= 0x02070000 37 #define HAVE_LONG_LONG 41 #define PY_LONG_LONG LONG_LONG 44 #define Py_HUGE_VAL HUGE_VAL 47 #define CYTHON_COMPILING_IN_PYPY 1 48 #define CYTHON_COMPILING_IN_PYSTON 0 49 #define CYTHON_COMPILING_IN_CPYTHON 0 50 #undef CYTHON_USE_TYPE_SLOTS 51 #define CYTHON_USE_TYPE_SLOTS 0 52 #undef CYTHON_USE_PYTYPE_LOOKUP 53 #define CYTHON_USE_PYTYPE_LOOKUP 0 54 #if PY_VERSION_HEX < 0x03050000 55 #undef CYTHON_USE_ASYNC_SLOTS 56 #define CYTHON_USE_ASYNC_SLOTS 0 57 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 58 #define CYTHON_USE_ASYNC_SLOTS 1 60 #undef CYTHON_USE_PYLIST_INTERNALS 61 #define CYTHON_USE_PYLIST_INTERNALS 0 62 #undef CYTHON_USE_UNICODE_INTERNALS 63 #define CYTHON_USE_UNICODE_INTERNALS 0 64 #undef CYTHON_USE_UNICODE_WRITER 65 #define CYTHON_USE_UNICODE_WRITER 0 66 #undef CYTHON_USE_PYLONG_INTERNALS 67 #define CYTHON_USE_PYLONG_INTERNALS 0 68 #undef CYTHON_AVOID_BORROWED_REFS 69 #define CYTHON_AVOID_BORROWED_REFS 1 70 #undef CYTHON_ASSUME_SAFE_MACROS 71 #define CYTHON_ASSUME_SAFE_MACROS 0 72 #undef CYTHON_UNPACK_METHODS 73 #define CYTHON_UNPACK_METHODS 0 74 #undef CYTHON_FAST_THREAD_STATE 75 #define CYTHON_FAST_THREAD_STATE 0 76 #undef CYTHON_FAST_PYCALL 77 #define CYTHON_FAST_PYCALL 0 78 #undef CYTHON_PEP489_MULTI_PHASE_INIT 79 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 80 #undef CYTHON_USE_TP_FINALIZE 81 #define CYTHON_USE_TP_FINALIZE 0 82 #undef CYTHON_USE_DICT_VERSIONS 83 #define CYTHON_USE_DICT_VERSIONS 0 84 #undef CYTHON_USE_EXC_INFO_STACK 85 #define CYTHON_USE_EXC_INFO_STACK 0 86 #elif defined(PYSTON_VERSION) 87 #define CYTHON_COMPILING_IN_PYPY 0 88 #define CYTHON_COMPILING_IN_PYSTON 1 89 #define CYTHON_COMPILING_IN_CPYTHON 0 90 #ifndef CYTHON_USE_TYPE_SLOTS 91 #define CYTHON_USE_TYPE_SLOTS 1 93 #undef CYTHON_USE_PYTYPE_LOOKUP 94 #define CYTHON_USE_PYTYPE_LOOKUP 0 95 #undef CYTHON_USE_ASYNC_SLOTS 96 #define CYTHON_USE_ASYNC_SLOTS 0 97 #undef CYTHON_USE_PYLIST_INTERNALS 98 #define CYTHON_USE_PYLIST_INTERNALS 0 99 #ifndef CYTHON_USE_UNICODE_INTERNALS 100 #define CYTHON_USE_UNICODE_INTERNALS 1 102 #undef CYTHON_USE_UNICODE_WRITER 103 #define CYTHON_USE_UNICODE_WRITER 0 104 #undef CYTHON_USE_PYLONG_INTERNALS 105 #define CYTHON_USE_PYLONG_INTERNALS 0 106 #ifndef CYTHON_AVOID_BORROWED_REFS 107 #define CYTHON_AVOID_BORROWED_REFS 0 109 #ifndef CYTHON_ASSUME_SAFE_MACROS 110 #define CYTHON_ASSUME_SAFE_MACROS 1 112 #ifndef CYTHON_UNPACK_METHODS 113 #define CYTHON_UNPACK_METHODS 1 115 #undef CYTHON_FAST_THREAD_STATE 116 #define CYTHON_FAST_THREAD_STATE 0 117 #undef CYTHON_FAST_PYCALL 118 #define CYTHON_FAST_PYCALL 0 119 #undef CYTHON_PEP489_MULTI_PHASE_INIT 120 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 121 #undef CYTHON_USE_TP_FINALIZE 122 #define CYTHON_USE_TP_FINALIZE 0 123 #undef CYTHON_USE_DICT_VERSIONS 124 #define CYTHON_USE_DICT_VERSIONS 0 125 #undef CYTHON_USE_EXC_INFO_STACK 126 #define CYTHON_USE_EXC_INFO_STACK 0 128 #define CYTHON_COMPILING_IN_PYPY 0 129 #define CYTHON_COMPILING_IN_PYSTON 0 130 #define CYTHON_COMPILING_IN_CPYTHON 1 131 #ifndef CYTHON_USE_TYPE_SLOTS 132 #define CYTHON_USE_TYPE_SLOTS 1 134 #if PY_VERSION_HEX < 0x02070000 135 #undef CYTHON_USE_PYTYPE_LOOKUP 136 #define CYTHON_USE_PYTYPE_LOOKUP 0 137 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) 138 #define CYTHON_USE_PYTYPE_LOOKUP 1 140 #if PY_MAJOR_VERSION < 3 141 #undef CYTHON_USE_ASYNC_SLOTS 142 #define CYTHON_USE_ASYNC_SLOTS 0 143 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 144 #define CYTHON_USE_ASYNC_SLOTS 1 146 #if PY_VERSION_HEX < 0x02070000 147 #undef CYTHON_USE_PYLONG_INTERNALS 148 #define CYTHON_USE_PYLONG_INTERNALS 0 149 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) 150 #define CYTHON_USE_PYLONG_INTERNALS 1 152 #ifndef CYTHON_USE_PYLIST_INTERNALS 153 #define CYTHON_USE_PYLIST_INTERNALS 1 155 #ifndef CYTHON_USE_UNICODE_INTERNALS 156 #define CYTHON_USE_UNICODE_INTERNALS 1 158 #if PY_VERSION_HEX < 0x030300F0 159 #undef CYTHON_USE_UNICODE_WRITER 160 #define CYTHON_USE_UNICODE_WRITER 0 161 #elif !defined(CYTHON_USE_UNICODE_WRITER) 162 #define CYTHON_USE_UNICODE_WRITER 1 164 #ifndef CYTHON_AVOID_BORROWED_REFS 165 #define CYTHON_AVOID_BORROWED_REFS 0 167 #ifndef CYTHON_ASSUME_SAFE_MACROS 168 #define CYTHON_ASSUME_SAFE_MACROS 1 170 #ifndef CYTHON_UNPACK_METHODS 171 #define CYTHON_UNPACK_METHODS 1 173 #ifndef CYTHON_FAST_THREAD_STATE 174 #define CYTHON_FAST_THREAD_STATE 1 176 #ifndef CYTHON_FAST_PYCALL 177 #define CYTHON_FAST_PYCALL 1 179 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT 180 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) 182 #ifndef CYTHON_USE_TP_FINALIZE 183 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) 185 #ifndef CYTHON_USE_DICT_VERSIONS 186 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) 188 #ifndef CYTHON_USE_EXC_INFO_STACK 189 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) 192 #if !defined(CYTHON_FAST_PYCCALL) 193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) 195 #if CYTHON_USE_PYLONG_INTERNALS 196 #include "longintrepr.h" 201 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
204 #ifndef __has_attribute 205 #define __has_attribute(x) 0 207 #ifndef __has_cpp_attribute 208 #define __has_cpp_attribute(x) 0 210 #ifndef CYTHON_RESTRICT 211 #if defined(__GNUC__) 212 #define CYTHON_RESTRICT __restrict__ 213 #elif defined(_MSC_VER) && _MSC_VER >= 1400 214 #define CYTHON_RESTRICT __restrict 215 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 216 #define CYTHON_RESTRICT restrict 218 #define CYTHON_RESTRICT 221 #ifndef CYTHON_UNUSED 222 # if defined(__GNUC__) 223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 224 # define CYTHON_UNUSED __attribute__ ((__unused__)) 226 # define CYTHON_UNUSED 228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) 229 # define CYTHON_UNUSED __attribute__ ((__unused__)) 231 # define CYTHON_UNUSED 234 #ifndef CYTHON_MAYBE_UNUSED_VAR 235 # if defined(__cplusplus) 236 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) 241 #ifndef CYTHON_NCP_UNUSED 242 # if CYTHON_COMPILING_IN_CPYTHON 243 # define CYTHON_NCP_UNUSED 245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED 248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) 250 #ifndef _MSC_STDINT_H_ 252 typedef unsigned char uint8_t;
253 typedef unsigned int uint32_t;
255 typedef unsigned __int8 uint8_t;
256 typedef unsigned __int32 uint32_t;
262 #ifndef CYTHON_FALLTHROUGH 263 #if defined(__cplusplus) && __cplusplus >= 201103L 264 #if __has_cpp_attribute(fallthrough) 265 #define CYTHON_FALLTHROUGH [[fallthrough]] 266 #elif __has_cpp_attribute(clang::fallthrough) 267 #define CYTHON_FALLTHROUGH [[clang::fallthrough]] 268 #elif __has_cpp_attribute(gnu::fallthrough) 269 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] 272 #ifndef CYTHON_FALLTHROUGH 273 #if __has_attribute(fallthrough) 274 #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) 276 #define CYTHON_FALLTHROUGH 279 #if defined(__clang__ ) && defined(__apple_build_version__) 280 #if __apple_build_version__ < 7000000 281 #undef CYTHON_FALLTHROUGH 282 #define CYTHON_FALLTHROUGH 287 #ifndef CYTHON_INLINE 288 #if defined(__clang__) 289 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) 290 #elif defined(__GNUC__) 291 #define CYTHON_INLINE __inline__ 292 #elif defined(_MSC_VER) 293 #define CYTHON_INLINE __inline 294 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 295 #define CYTHON_INLINE inline 297 #define CYTHON_INLINE 301 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) 302 #define Py_OptimizeFlag 0 304 #define __PYX_BUILD_PY_SSIZE_T "n" 305 #define CYTHON_FORMAT_SSIZE_T "z" 306 #if PY_MAJOR_VERSION < 3 307 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" 308 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 309 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 310 #define __Pyx_DefaultClassType PyClass_Type 312 #define __Pyx_BUILTIN_MODULE_NAME "builtins" 313 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 314 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 315 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 317 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 318 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 320 #define __Pyx_DefaultClassType PyType_Type 322 #ifndef Py_TPFLAGS_CHECKTYPES 323 #define Py_TPFLAGS_CHECKTYPES 0 325 #ifndef Py_TPFLAGS_HAVE_INDEX 326 #define Py_TPFLAGS_HAVE_INDEX 0 328 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER 329 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 331 #ifndef Py_TPFLAGS_HAVE_FINALIZE 332 #define Py_TPFLAGS_HAVE_FINALIZE 0 334 #ifndef METH_STACKLESS 335 #define METH_STACKLESS 0 337 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) 338 #ifndef METH_FASTCALL 339 #define METH_FASTCALL 0x80 341 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
342 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
343 Py_ssize_t nargs, PyObject *kwnames);
345 #define __Pyx_PyCFunctionFast _PyCFunctionFast 346 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords 348 #if CYTHON_FAST_PYCCALL 349 #define __Pyx_PyFastCFunction_Check(func)\ 350 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) 352 #define __Pyx_PyFastCFunction_Check(func) 0 354 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) 355 #define PyObject_Malloc(s) PyMem_Malloc(s) 356 #define PyObject_Free(p) PyMem_Free(p) 357 #define PyObject_Realloc(p) PyMem_Realloc(p) 359 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 360 #define PyMem_RawMalloc(n) PyMem_Malloc(n) 361 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) 362 #define PyMem_RawFree(p) PyMem_Free(p) 364 #if CYTHON_COMPILING_IN_PYSTON 365 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) 366 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) 368 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) 369 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) 371 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 372 #define __Pyx_PyThreadState_Current PyThreadState_GET() 373 #elif PY_VERSION_HEX >= 0x03060000 374 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() 375 #elif PY_VERSION_HEX >= 0x03000000 376 #define __Pyx_PyThreadState_Current PyThreadState_GET() 378 #define __Pyx_PyThreadState_Current _PyThreadState_Current 380 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) 381 #include "pythread.h" 382 #define Py_tss_NEEDS_INIT 0 383 typedef int Py_tss_t;
384 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
385 *key = PyThread_create_key();
388 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
389 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
390 *key = Py_tss_NEEDS_INIT;
393 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
396 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
397 return *key != Py_tss_NEEDS_INIT;
399 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
400 PyThread_delete_key(*key);
401 *key = Py_tss_NEEDS_INIT;
403 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
404 return PyThread_set_key_value(*key, value);
406 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
407 return PyThread_get_key_value(*key);
410 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) 411 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) 413 #define __Pyx_PyDict_NewPresized(n) PyDict_New() 415 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION 416 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) 417 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) 419 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) 420 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) 422 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS 423 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) 425 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) 427 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) 428 #define CYTHON_PEP393_ENABLED 1 429 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 430 0 : _PyUnicode_Ready((PyObject *)(op))) 431 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) 432 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) 433 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) 434 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) 435 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) 436 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) 437 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) 438 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) 440 #define CYTHON_PEP393_ENABLED 0 441 #define PyUnicode_1BYTE_KIND 1 442 #define PyUnicode_2BYTE_KIND 2 443 #define PyUnicode_4BYTE_KIND 4 444 #define __Pyx_PyUnicode_READY(op) (0) 445 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) 446 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) 447 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) 448 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) 449 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) 450 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) 451 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) 452 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) 454 #if CYTHON_COMPILING_IN_PYPY 455 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) 456 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) 458 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) 459 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ 460 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) 462 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) 463 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) 465 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) 466 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) 468 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) 469 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) 471 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) 472 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) 473 #if PY_MAJOR_VERSION >= 3 474 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) 476 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) 478 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) 479 #define PyObject_ASCII(o) PyObject_Repr(o) 481 #if PY_MAJOR_VERSION >= 3 482 #define PyBaseString_Type PyUnicode_Type 483 #define PyStringObject PyUnicodeObject 484 #define PyString_Type PyUnicode_Type 485 #define PyString_Check PyUnicode_Check 486 #define PyString_CheckExact PyUnicode_CheckExact 487 #ifndef PyObject_Unicode 488 #define PyObject_Unicode PyObject_Str 491 #if PY_MAJOR_VERSION >= 3 492 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) 493 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) 495 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) 496 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) 498 #ifndef PySet_CheckExact 499 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) 501 #if CYTHON_ASSUME_SAFE_MACROS 502 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) 504 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) 506 #if PY_MAJOR_VERSION >= 3 507 #define PyIntObject PyLongObject 508 #define PyInt_Type PyLong_Type 509 #define PyInt_Check(op) PyLong_Check(op) 510 #define PyInt_CheckExact(op) PyLong_CheckExact(op) 511 #define PyInt_FromString PyLong_FromString 512 #define PyInt_FromUnicode PyLong_FromUnicode 513 #define PyInt_FromLong PyLong_FromLong 514 #define PyInt_FromSize_t PyLong_FromSize_t 515 #define PyInt_FromSsize_t PyLong_FromSsize_t 516 #define PyInt_AsLong PyLong_AsLong 517 #define PyInt_AS_LONG PyLong_AS_LONG 518 #define PyInt_AsSsize_t PyLong_AsSsize_t 519 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask 520 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask 521 #define PyNumber_Int PyNumber_Long 523 #if PY_MAJOR_VERSION >= 3 524 #define PyBoolObject PyLongObject 526 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY 527 #ifndef PyUnicode_InternFromString 528 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) 531 #if PY_VERSION_HEX < 0x030200A4 532 typedef long Py_hash_t;
533 #define __Pyx_PyInt_FromHash_t PyInt_FromLong 534 #define __Pyx_PyInt_AsHash_t PyInt_AsLong 536 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t 537 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t 539 #if PY_MAJOR_VERSION >= 3 540 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) 542 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) 544 #if CYTHON_USE_ASYNC_SLOTS 545 #if PY_VERSION_HEX >= 0x030500B1 546 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods 547 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) 549 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) 552 #define __Pyx_PyType_AsAsync(obj) NULL 554 #ifndef __Pyx_PyAsyncMethodsStruct 559 } __Pyx_PyAsyncMethodsStruct;
562 #if defined(WIN32) || defined(MS_WINDOWS) 563 #define _USE_MATH_DEFINES 567 #define __PYX_NAN() ((float) NAN) 569 static CYTHON_INLINE
float __PYX_NAN() {
571 memset(&value, 0xFF,
sizeof(value));
575 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) 576 #define __Pyx_truncl trunc 578 #define __Pyx_truncl truncl 582 #define __PYX_ERR(f_index, lineno, Ln_error) \ 584 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ 587 #ifndef __PYX_EXTERN_C 589 #define __PYX_EXTERN_C extern "C" 591 #define __PYX_EXTERN_C extern 595 #define __PYX_HAVE__subsurfaceTransportFunctions 596 #define __PYX_HAVE_API__subsurfaceTransportFunctions 600 #include "numpy/arrayobject.h" 601 #include "numpy/ufuncobject.h" 607 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) 608 #define CYTHON_WITHOUT_ASSERTIONS 611 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
612 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
614 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 615 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 616 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) 617 #define __PYX_DEFAULT_STRING_ENCODING "" 618 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString 619 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 620 #define __Pyx_uchar_cast(c) ((unsigned char)c) 621 #define __Pyx_long_cast(x) ((long)x) 622 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ 623 (sizeof(type) < sizeof(Py_ssize_t)) ||\ 624 (sizeof(type) > sizeof(Py_ssize_t) &&\ 625 likely(v < (type)PY_SSIZE_T_MAX ||\ 626 v == (type)PY_SSIZE_T_MAX) &&\ 627 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ 628 v == (type)PY_SSIZE_T_MIN))) ||\ 629 (sizeof(type) == sizeof(Py_ssize_t) &&\ 630 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ 631 v == (type)PY_SSIZE_T_MAX))) ) 632 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
633 return (
size_t) i < (size_t) limit;
635 #if defined (__cplusplus) && __cplusplus >= 201103L 637 #define __Pyx_sst_abs(value) std::abs(value) 638 #elif SIZEOF_INT >= SIZEOF_SIZE_T 639 #define __Pyx_sst_abs(value) abs(value) 640 #elif SIZEOF_LONG >= SIZEOF_SIZE_T 641 #define __Pyx_sst_abs(value) labs(value) 642 #elif defined (_MSC_VER) 643 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) 644 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 645 #define __Pyx_sst_abs(value) llabs(value) 646 #elif defined (__GNUC__) 647 #define __Pyx_sst_abs(value) __builtin_llabs(value) 649 #define __Pyx_sst_abs(value) ((value<0) ? -value : value) 651 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
652 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
653 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) 654 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) 655 #define __Pyx_PyBytes_FromString PyBytes_FromString 656 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize 657 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
658 #if PY_MAJOR_VERSION < 3 659 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString 660 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 662 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString 663 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize 665 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) 666 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) 667 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) 668 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) 669 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) 670 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) 671 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) 672 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) 673 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) 674 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) 675 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) 676 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) 677 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) 678 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) 679 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) 680 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 681 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
682 const Py_UNICODE *u_end =
u;
684 return (
size_t)(u_end - u - 1);
686 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) 687 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode 688 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode 689 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) 690 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) 691 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
692 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
693 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
694 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
695 #define __Pyx_PySequence_Tuple(obj)\ 696 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) 697 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
698 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
699 #if CYTHON_ASSUME_SAFE_MACROS 700 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) 702 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) 704 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) 705 #if PY_MAJOR_VERSION >= 3 706 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) 708 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) 710 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) 711 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 712 static int __Pyx_sys_getdefaultencoding_not_ascii;
713 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
715 PyObject* default_encoding = NULL;
716 PyObject* ascii_chars_u = NULL;
717 PyObject* ascii_chars_b = NULL;
718 const char* default_encoding_c;
719 sys = PyImport_ImportModule(
"sys");
721 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
723 if (!default_encoding)
goto bad;
724 default_encoding_c = PyBytes_AsString(default_encoding);
725 if (!default_encoding_c)
goto bad;
726 if (strcmp(default_encoding_c,
"ascii") == 0) {
727 __Pyx_sys_getdefaultencoding_not_ascii = 0;
729 char ascii_chars[128];
731 for (c = 0; c < 128; c++) {
734 __Pyx_sys_getdefaultencoding_not_ascii = 1;
735 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
736 if (!ascii_chars_u)
goto bad;
737 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
738 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
741 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
745 Py_DECREF(ascii_chars_u);
746 Py_DECREF(ascii_chars_b);
748 Py_DECREF(default_encoding);
751 Py_XDECREF(default_encoding);
752 Py_XDECREF(ascii_chars_u);
753 Py_XDECREF(ascii_chars_b);
757 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 758 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) 760 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) 761 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 762 static char* __PYX_DEFAULT_STRING_ENCODING;
763 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
765 PyObject* default_encoding = NULL;
766 char* default_encoding_c;
767 sys = PyImport_ImportModule(
"sys");
769 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
771 if (!default_encoding)
goto bad;
772 default_encoding_c = PyBytes_AsString(default_encoding);
773 if (!default_encoding_c)
goto bad;
774 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
775 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
776 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
777 Py_DECREF(default_encoding);
780 Py_XDECREF(default_encoding);
788 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) 789 #define likely(x) __builtin_expect(!!(x), 1) 790 #define unlikely(x) __builtin_expect(!!(x), 0) 792 #define likely(x) (x) 793 #define unlikely(x) (x) 795 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
797 static PyObject *__pyx_m = NULL;
798 static PyObject *__pyx_d;
799 static PyObject *__pyx_b;
800 static PyObject *__pyx_cython_runtime = NULL;
801 static PyObject *__pyx_empty_tuple;
802 static PyObject *__pyx_empty_bytes;
803 static PyObject *__pyx_empty_unicode;
804 static int __pyx_lineno;
805 static int __pyx_clineno = 0;
806 static const char * __pyx_cfilenm= __FILE__;
807 static const char *__pyx_filename;
810 #if !defined(CYTHON_CCOMPLEX) 811 #if defined(__cplusplus) 812 #define CYTHON_CCOMPLEX 1 813 #elif defined(_Complex_I) 814 #define CYTHON_CCOMPLEX 1 816 #define CYTHON_CCOMPLEX 0 826 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) 828 #define _Complex_I 1.0fj 832 static const char *__pyx_f[] = {
833 "proteus/subsurfaceTransportFunctions.pyx",
834 "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd",
835 "linux/lib/python3.7/site-packages/Cython/Includes/cpython/type.pxd",
838 #define IS_UNSIGNED(type) (((type) -1) > 0) 839 struct __Pyx_StructField_;
840 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) 843 struct __Pyx_StructField_* fields;
851 typedef struct __Pyx_StructField_ {
852 __Pyx_TypeInfo* type;
857 __Pyx_StructField* field;
858 size_t parent_offset;
859 } __Pyx_BufFmt_StackElem;
861 __Pyx_StructField root;
862 __Pyx_BufFmt_StackElem* head;
864 size_t new_count, enc_count;
865 size_t struct_alignment;
871 } __Pyx_BufFmt_Context;
881 typedef npy_int8 __pyx_t_5numpy_int8_t;
890 typedef npy_int16 __pyx_t_5numpy_int16_t;
899 typedef npy_int32 __pyx_t_5numpy_int32_t;
908 typedef npy_int64 __pyx_t_5numpy_int64_t;
917 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
926 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
935 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
944 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
953 typedef npy_float32 __pyx_t_5numpy_float32_t;
962 typedef npy_float64 __pyx_t_5numpy_float64_t;
971 typedef npy_long __pyx_t_5numpy_int_t;
980 typedef npy_longlong __pyx_t_5numpy_long_t;
989 typedef npy_longlong __pyx_t_5numpy_longlong_t;
998 typedef npy_ulong __pyx_t_5numpy_uint_t;
1007 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1016 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1025 typedef npy_intp __pyx_t_5numpy_intp_t;
1034 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1043 typedef npy_double __pyx_t_5numpy_float_t;
1052 typedef npy_double __pyx_t_5numpy_double_t;
1061 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1070 typedef __pyx_t_5numpy_double_t __pyx_t_28subsurfaceTransportFunctions_DTYPE_t;
1079 typedef int __pyx_t_28subsurfaceTransportFunctions_ITYPE_t;
1083 typedef ::std::complex< float > __pyx_t_float_complex;
1085 typedef float _Complex __pyx_t_float_complex;
1088 typedef struct {
float real, imag; } __pyx_t_float_complex;
1090 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1095 typedef ::std::complex< double > __pyx_t_double_complex;
1097 typedef double _Complex __pyx_t_double_complex;
1100 typedef struct {
double real, imag; } __pyx_t_double_complex;
1102 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1114 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1123 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1132 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1141 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1145 #ifndef CYTHON_REFNANNY 1146 #define CYTHON_REFNANNY 0 1150 void (*INCREF)(
void*, PyObject*, int);
1151 void (*DECREF)(
void*, PyObject*, int);
1152 void (*GOTREF)(
void*, PyObject*, int);
1153 void (*GIVEREF)(
void*, PyObject*, int);
1154 void* (*SetupContext)(
const char*, int,
const char*);
1155 void (*FinishContext)(
void**);
1156 } __Pyx_RefNannyAPIStruct;
1157 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1158 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1159 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; 1161 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1163 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ 1164 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1165 PyGILState_Release(__pyx_gilstate_save);\ 1167 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1170 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1171 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) 1173 #define __Pyx_RefNannyFinishContext()\ 1174 __Pyx_RefNanny->FinishContext(&__pyx_refnanny) 1175 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1176 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1177 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1178 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1179 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) 1180 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) 1181 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) 1182 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) 1184 #define __Pyx_RefNannyDeclarations 1185 #define __Pyx_RefNannySetupContext(name, acquire_gil) 1186 #define __Pyx_RefNannyFinishContext() 1187 #define __Pyx_INCREF(r) Py_INCREF(r) 1188 #define __Pyx_DECREF(r) Py_DECREF(r) 1189 #define __Pyx_GOTREF(r) 1190 #define __Pyx_GIVEREF(r) 1191 #define __Pyx_XINCREF(r) Py_XINCREF(r) 1192 #define __Pyx_XDECREF(r) Py_XDECREF(r) 1193 #define __Pyx_XGOTREF(r) 1194 #define __Pyx_XGIVEREF(r) 1196 #define __Pyx_XDECREF_SET(r, v) do {\ 1197 PyObject *tmp = (PyObject *) r;\ 1198 r = v; __Pyx_XDECREF(tmp);\ 1200 #define __Pyx_DECREF_SET(r, v) do {\ 1201 PyObject *tmp = (PyObject *) r;\ 1202 r = v; __Pyx_DECREF(tmp);\ 1204 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) 1205 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) 1208 #if CYTHON_USE_TYPE_SLOTS 1209 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1211 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) 1215 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1218 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1219 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1222 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1225 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1226 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1227 const char* function_name);
1230 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ 1231 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ 1232 __Pyx__ArgTypeTest(obj, type, name, exact)) 1233 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1236 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
1239 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
1240 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1241 __Pyx_BufFmt_StackElem* stack,
1242 __Pyx_TypeInfo* type);
1245 #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\ 1246 ((obj == Py_None || obj == NULL) ?\ 1247 (__Pyx_ZeroBuffer(buf), 0) :\ 1248 __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)) 1249 static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
1250 __Pyx_TypeInfo* dtype,
int flags,
int nd,
int cast, __Pyx_BufFmt_StackElem* stack);
1251 static void __Pyx_ZeroBuffer(Py_buffer* buf);
1252 static CYTHON_INLINE
void __Pyx_SafeReleaseBuffer(Py_buffer* info);
1253 static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
1254 static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
1257 static void __Pyx_RaiseBufferIndexError(
int axis);
1259 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) 1260 #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) 1262 #if CYTHON_FAST_THREAD_STATE 1263 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; 1264 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; 1265 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type 1267 #define __Pyx_PyThreadState_declare 1268 #define __Pyx_PyThreadState_assign 1269 #define __Pyx_PyErr_Occurred() PyErr_Occurred() 1273 #if CYTHON_FAST_THREAD_STATE 1274 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) 1275 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) 1276 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) 1277 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) 1278 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) 1279 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1280 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1281 #if CYTHON_COMPILING_IN_CPYTHON 1282 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) 1284 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1287 #define __Pyx_PyErr_Clear() PyErr_Clear() 1288 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1289 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) 1290 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) 1291 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) 1292 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) 1293 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) 1294 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) 1298 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY 1299 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1300 #define __Pyx_PyObject_Dict_GetItem(obj, name)\ 1301 (likely(PyDict_CheckExact(obj)) ?\ 1302 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) 1304 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) 1305 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) 1308 #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2) 1310 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1311 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1312 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ 1313 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ 1314 __Pyx_GetItemInt_Generic(o, to_py_func(i)))) 1315 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1316 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1317 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ 1318 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) 1319 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1320 int wraparound,
int boundscheck);
1321 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1322 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1323 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ 1324 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) 1325 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1326 int wraparound,
int boundscheck);
1327 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1328 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1329 int is_list,
int wraparound,
int boundscheck);
1332 #if CYTHON_USE_TYPE_SLOTS 1333 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1335 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) 1339 #if !CYTHON_COMPILING_IN_PYPY 1340 static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check);
1342 #define __Pyx_PyFloat_AddObjC(op1, op2, floatval, inplace, zerodivision_check)\ 1343 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) 1346 #define __Pyx_BufPtrStrided4d(type, buf, i0, s0, i1, s1, i2, s2, i3, s3) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2 + i3 * s3) 1348 #if CYTHON_FAST_PYCALL 1349 #define __Pyx_PyFunction_FastCall(func, args, nargs)\ 1350 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) 1351 #if 1 || PY_VERSION_HEX < 0x030600B1 1352 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1354 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) 1356 #define __Pyx_BUILD_ASSERT_EXPR(cond)\ 1357 (sizeof(char [1 - 2*!(cond)]) - 1) 1358 #ifndef Py_MEMBER_SIZE 1359 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) 1361 static size_t __pyx_pyframe_localsplus_offset = 0;
1362 #include "frameobject.h" 1363 #define __Pxy_PyFrame_Initialize_Offsets()\ 1364 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ 1365 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) 1366 #define __Pyx_PyFrame_GetLocalsplus(frame)\ 1367 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) 1371 #if CYTHON_FAST_PYCCALL 1372 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1374 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) 1378 #if CYTHON_COMPILING_IN_CPYTHON 1379 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1381 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) 1385 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS 1386 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) 1387 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) 1388 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ 1389 (version_var) = __PYX_GET_DICT_VERSION(dict);\ 1390 (cache_var) = (value); 1391 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ 1392 static PY_UINT64_T __pyx_dict_version = 0;\ 1393 static PyObject *__pyx_dict_cached_value = NULL;\ 1394 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ 1395 (VAR) = __pyx_dict_cached_value;\ 1397 (VAR) = __pyx_dict_cached_value = (LOOKUP);\ 1398 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ 1401 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1402 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1403 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1405 #define __PYX_GET_DICT_VERSION(dict) (0) 1406 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) 1407 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); 1411 #if CYTHON_USE_DICT_VERSIONS 1412 #define __Pyx_GetModuleGlobalName(var, name) {\ 1413 static PY_UINT64_T __pyx_dict_version = 0;\ 1414 static PyObject *__pyx_dict_cached_value = NULL;\ 1415 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ 1416 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ 1417 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ 1419 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\ 1420 PY_UINT64_T __pyx_dict_version;\ 1421 PyObject *__pyx_dict_cached_value;\ 1422 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ 1424 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1426 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) 1427 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) 1428 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1432 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1435 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1438 #if CYTHON_COMPILING_IN_CPYTHON 1439 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1443 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1446 static double __Pyx__PyObject_AsDouble(PyObject* obj);
1447 #if CYTHON_COMPILING_IN_PYPY 1448 #define __Pyx_PyObject_AsDouble(obj)\ 1449 (likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\ 1450 likely(PyInt_CheckExact(obj)) ?\ 1451 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) 1453 #define __Pyx_PyObject_AsDouble(obj)\ 1454 ((likely(PyFloat_CheckExact(obj))) ?\ 1455 PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) 1459 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1462 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1465 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1468 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
1471 #if CYTHON_USE_EXC_INFO_STACK 1472 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1476 #if CYTHON_FAST_THREAD_STATE 1477 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) 1478 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1479 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) 1480 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1482 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) 1483 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) 1487 #if CYTHON_FAST_THREAD_STATE 1488 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) 1489 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1491 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) 1495 #if CYTHON_FAST_THREAD_STATE 1496 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) 1497 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1499 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1503 #ifndef __PYX_HAVE_RT_ImportType_proto 1504 #define __PYX_HAVE_RT_ImportType_proto 1505 enum __Pyx_ImportType_CheckSize {
1506 __Pyx_ImportType_CheckSize_Error = 0,
1507 __Pyx_ImportType_CheckSize_Warn = 1,
1508 __Pyx_ImportType_CheckSize_Ignore = 2
1510 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
1514 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1517 #ifdef CYTHON_CLINE_IN_TRACEBACK 1518 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) 1520 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1525 PyCodeObject* code_object;
1527 } __Pyx_CodeObjectCacheEntry;
1528 struct __Pyx_CodeObjectCache {
1531 __Pyx_CodeObjectCacheEntry* entries;
1533 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1534 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1535 static PyCodeObject *__pyx_find_code_object(
int code_line);
1536 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1539 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1540 int py_line,
const char *filename);
1544 Py_ssize_t shape, strides, suboffsets;
1545 } __Pyx_Buf_DimInfo;
1551 __Pyx_Buffer *rcbuffer;
1553 __Pyx_Buf_DimInfo diminfo[8];
1554 } __Pyx_LocalBuf_ND;
1556 #if PY_MAJOR_VERSION < 3 1557 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
1558 static void __Pyx_ReleaseBuffer(Py_buffer *view);
1560 #define __Pyx_GetBuffer PyObject_GetBuffer 1561 #define __Pyx_ReleaseBuffer PyBuffer_Release 1566 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1569 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);
1572 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1577 #define __Pyx_CREAL(z) ((z).real()) 1578 #define __Pyx_CIMAG(z) ((z).imag()) 1580 #define __Pyx_CREAL(z) (__real__(z)) 1581 #define __Pyx_CIMAG(z) (__imag__(z)) 1584 #define __Pyx_CREAL(z) ((z).real) 1585 #define __Pyx_CIMAG(z) ((z).imag) 1587 #if defined(__cplusplus) && CYTHON_CCOMPLEX\ 1588 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) 1589 #define __Pyx_SET_CREAL(z,x) ((z).real(x)) 1590 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) 1592 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) 1593 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) 1598 #define __Pyx_c_eq_float(a, b) ((a)==(b)) 1599 #define __Pyx_c_sum_float(a, b) ((a)+(b)) 1600 #define __Pyx_c_diff_float(a, b) ((a)-(b)) 1601 #define __Pyx_c_prod_float(a, b) ((a)*(b)) 1602 #define __Pyx_c_quot_float(a, b) ((a)/(b)) 1603 #define __Pyx_c_neg_float(a) (-(a)) 1605 #define __Pyx_c_is_zero_float(z) ((z)==(float)0) 1606 #define __Pyx_c_conj_float(z) (::std::conj(z)) 1608 #define __Pyx_c_abs_float(z) (::std::abs(z)) 1609 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) 1612 #define __Pyx_c_is_zero_float(z) ((z)==0) 1613 #define __Pyx_c_conj_float(z) (conjf(z)) 1615 #define __Pyx_c_abs_float(z) (cabsf(z)) 1616 #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) 1620 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1621 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1622 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1623 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1624 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1625 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1626 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1627 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1629 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
1630 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1636 #define __Pyx_c_eq_double(a, b) ((a)==(b)) 1637 #define __Pyx_c_sum_double(a, b) ((a)+(b)) 1638 #define __Pyx_c_diff_double(a, b) ((a)-(b)) 1639 #define __Pyx_c_prod_double(a, b) ((a)*(b)) 1640 #define __Pyx_c_quot_double(a, b) ((a)/(b)) 1641 #define __Pyx_c_neg_double(a) (-(a)) 1643 #define __Pyx_c_is_zero_double(z) ((z)==(double)0) 1644 #define __Pyx_c_conj_double(z) (::std::conj(z)) 1646 #define __Pyx_c_abs_double(z) (::std::abs(z)) 1647 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) 1650 #define __Pyx_c_is_zero_double(z) ((z)==0) 1651 #define __Pyx_c_conj_double(z) (conj(z)) 1653 #define __Pyx_c_abs_double(z) (cabs(z)) 1654 #define __Pyx_c_pow_double(a, b) (cpow(a, b)) 1658 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1659 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1660 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1661 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1662 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1663 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1664 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1665 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1667 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
1668 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1673 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value);
1676 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1679 static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *);
1682 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1685 #if CYTHON_COMPILING_IN_CPYTHON 1686 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) 1687 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1688 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1689 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1691 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) 1692 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) 1693 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) 1695 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) 1698 static int __Pyx_check_binary_version(
void);
1701 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1713 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1726 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1727 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1728 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1729 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1730 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1731 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *,
char *,
char *,
int *);
1734 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t = {
"ITYPE_t", NULL,
sizeof(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t) ?
'U' :
'I', IS_UNSIGNED(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t), 0 };
1735 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t = {
"DTYPE_t", NULL,
sizeof(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t), { 0 }, 0,
'R', 0, 0 };
1736 #define __Pyx_MODULE_NAME "subsurfaceTransportFunctions" 1737 extern int __pyx_module_is_main_subsurfaceTransportFunctions;
1738 int __pyx_module_is_main_subsurfaceTransportFunctions = 0;
1741 static PyObject *__pyx_builtin_range;
1742 static PyObject *__pyx_builtin_ValueError;
1743 static PyObject *__pyx_builtin_RuntimeError;
1744 static PyObject *__pyx_builtin_ImportError;
1745 static const char __pyx_k_I[] =
"I";
1746 static const char __pyx_k_J[] =
"J";
1747 static const char __pyx_k_d[] =
"d";
1748 static const char __pyx_k_i[] =
"i";
1749 static const char __pyx_k_j[] =
"j";
1750 static const char __pyx_k_k[] =
"k";
1751 static const char __pyx_k_m[] =
"m";
1752 static const char __pyx_k_n[] =
"n";
1753 static const char __pyx_k_q[] =
"q";
1754 static const char __pyx_k_t[] =
"t";
1755 static const char __pyx_k_v[] =
"v";
1756 static const char __pyx_k_w[] =
"w";
1757 static const char __pyx_k_x[] =
"x";
1758 static const char __pyx_k_dS[] =
"dS";
1759 static const char __pyx_k_dV[] =
"dV";
1760 static const char __pyx_k_df[] =
"df";
1761 static const char __pyx_k_dm[] =
"dm";
1762 static const char __pyx_k_eN[] =
"eN";
1763 static const char __pyx_k_ii[] =
"ii";
1764 static const char __pyx_k_kb[] =
"kb";
1765 static const char __pyx_k_mt[] =
"mt";
1766 static const char __pyx_k_nd[] =
"nd";
1767 static const char __pyx_k_pi[] =
"pi";
1768 static const char __pyx_k_xc[] =
"xc";
1769 static const char __pyx_k_yc[] =
"yc";
1770 static const char __pyx_k_KWr[] =
"KWr";
1771 static const char __pyx_k_KWs[] =
"KWs";
1772 static const char __pyx_k_dmt[] =
"dmt";
1773 static const char __pyx_k_dot[] =
"dot";
1774 static const char __pyx_k_ebN[] =
"ebN";
1775 static const char __pyx_k_l2g[] =
"l2g";
1776 static const char __pyx_k_nnz[] =
"nnz";
1777 static const char __pyx_k_q_m[] =
"q_m";
1778 static const char __pyx_k_q_r[] =
"q_r";
1779 static const char __pyx_k_q_u[] =
"q_u";
1780 static const char __pyx_k_q_x[] =
"q_x";
1781 static const char __pyx_k_rho[] =
"rho";
1782 static const char __pyx_k_sum[] =
"sum";
1783 static const char __pyx_k_u_j[] =
"u_j";
1784 static const char __pyx_k_vol[] =
"vol";
1785 static const char __pyx_k_a_eN[] =
"a_eN";
1786 static const char __pyx_k_a_up[] =
"a_up";
1787 static const char __pyx_k_beta[] =
"beta";
1788 static const char __pyx_k_ebNE[] =
"ebNE";
1789 static const char __pyx_k_f_up[] =
"f_up";
1790 static const char __pyx_k_flat[] =
"flat";
1791 static const char __pyx_k_flux[] =
"flux";
1792 static const char __pyx_k_main[] =
"__main__";
1793 static const char __pyx_k_name[] =
"__name__";
1794 static const char __pyx_k_one8[] =
"one8";
1795 static const char __pyx_k_psiC[] =
"psiC";
1796 static const char __pyx_k_q_dm[] =
"q_dm";
1797 static const char __pyx_k_q_kr[] =
"q_kr";
1798 static const char __pyx_k_q_mt[] =
"q_mt";
1799 static const char __pyx_k_rho2[] =
"rho2";
1800 static const char __pyx_k_rhom[] =
"rhom";
1801 static const char __pyx_k_sBar[] =
"sBar";
1802 static const char __pyx_k_test[] =
"__test__";
1803 static const char __pyx_k_u_eN[] =
"u_eN";
1804 static const char __pyx_k_vBar[] =
"vBar";
1805 static const char __pyx_k_a_avg[] =
"a_avg";
1806 static const char __pyx_k_alpha[] =
"alpha";
1807 static const char __pyx_k_clock[] =
"clock";
1808 static const char __pyx_k_denom[] =
"denom";
1809 static const char __pyx_k_drhom[] =
"drhom";
1810 static const char __pyx_k_kr_eN[] =
"kr_eN";
1811 static const char __pyx_k_matID[] =
"matID";
1812 static const char __pyx_k_numer[] =
"numer";
1813 static const char __pyx_k_numpy[] =
"numpy";
1814 static const char __pyx_k_pcBar[] =
"pcBar";
1815 static const char __pyx_k_q_dkr[] =
"q_dkr";
1816 static const char __pyx_k_q_dmt[] =
"q_dmt";
1817 static const char __pyx_k_range[] =
"range";
1818 static const char __pyx_k_shape[] =
"shape";
1819 static const char __pyx_k_u_dof[] =
"u_dof";
1820 static const char __pyx_k_u_l2g[] =
"u_l2g";
1821 static const char __pyx_k_vBar2[] =
"vBar2";
1822 static const char __pyx_k_vol_e[] =
"vol_e";
1823 static const char __pyx_k_zeros[] =
"zeros";
1824 static const char __pyx_k_a_neig[] =
"a_neig";
1825 static const char __pyx_k_colind[] =
"colind";
1826 static const char __pyx_k_dkr_up[] =
"dkr_up";
1827 static const char __pyx_k_import[] =
"__import__";
1828 static const char __pyx_k_mt_avg[] =
"mt_avg";
1829 static const char __pyx_k_nSpace[] =
"nSpace";
1830 static const char __pyx_k_phi_eN[] =
"phi_eN";
1831 static const char __pyx_k_picard[] =
"picard";
1832 static const char __pyx_k_q_alin[] =
"q_alin";
1833 static const char __pyx_k_q_detJ[] =
"q_detJ";
1834 static const char __pyx_k_q_flin[] =
"q_flin";
1835 static const char __pyx_k_q_mass[] =
"q_mass";
1836 static const char __pyx_k_q_vals[] =
"q_vals";
1837 static const char __pyx_k_rowptr[] =
"rowptr";
1838 static const char __pyx_k_thetaR[] =
"thetaR";
1839 static const char __pyx_k_thetaS[] =
"thetaS";
1840 static const char __pyx_k_thetaW[] =
"thetaW";
1841 static const char __pyx_k_u_neig[] =
"u_neig";
1842 static const char __pyx_k_volume[] =
"volume";
1843 static const char __pyx_k_weight[] =
"weight";
1844 static const char __pyx_k_df_dofs[] =
"df_dofs";
1845 static const char __pyx_k_eN_left[] =
"eN_left";
1846 static const char __pyx_k_gravity[] =
"gravity";
1847 static const char __pyx_k_kr_neig[] =
"kr_neig";
1848 static const char __pyx_k_nSpace2[] =
"nSpace2";
1849 static const char __pyx_k_omega_e[] =
"omega_e";
1850 static const char __pyx_k_pcBar_n[] =
"pcBar_n";
1851 static const char __pyx_k_q_dmass[] =
"q_dmass";
1852 static const char __pyx_k_q_kr_up[] =
"q_kr_up";
1853 static const char __pyx_k_thetaSR[] =
"thetaSR";
1854 static const char __pyx_k_dmtj_avg[] =
"dmtj_avg";
1855 static const char __pyx_k_eN_right[] =
"eN_right";
1856 static const char __pyx_k_ebq_vals[] =
"ebq_vals";
1857 static const char __pyx_k_integral[] =
"integral";
1858 static const char __pyx_k_material[] =
"material";
1859 static const char __pyx_k_phi_neig[] =
"phi_neig";
1860 static const char __pyx_k_q_grad_u[] =
"q_grad_u";
1861 static const char __pyx_k_q_grad_v[] =
"q_grad_v";
1862 static const char __pyx_k_q_grad_w[] =
"q_grad_w";
1863 static const char __pyx_k_ebN_local[] =
"ebN_local";
1864 static const char __pyx_k_pcBar_nM1[] =
"pcBar_nM1";
1865 static const char __pyx_k_pcBar_nM2[] =
"pcBar_nM2";
1866 static const char __pyx_k_sqrt_sBar[] =
"sqrt_sBar";
1867 static const char __pyx_k_transient[] =
"transient";
1868 static const char __pyx_k_volFactor[] =
"volFactor";
1869 static const char __pyx_k_zVelocity[] =
"zVelocity";
1870 static const char __pyx_k_zvelocity[] =
"zvelocity";
1871 static const char __pyx_k_DKWr_DpsiC[] =
"DKWr_DpsiC";
1872 static const char __pyx_k_ValueError[] =
"ValueError";
1873 static const char __pyx_k_matID_neig[] =
"matID_neig";
1874 static const char __pyx_k_nAvgWeight[] =
"nAvgWeight";
1875 static const char __pyx_k_upwindFlag[] =
"upwindFlag";
1876 static const char __pyx_k_DsBar_DpsiC[] =
"DsBar_DpsiC";
1877 static const char __pyx_k_DvBar_DpsiC[] =
"DvBar_DpsiC";
1878 static const char __pyx_k_ImportError[] =
"ImportError";
1879 static const char __pyx_k_eN_neighbor[] =
"eN_neighbor";
1880 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
1881 static const char __pyx_k_tForReversal[] =
"tForReversal";
1882 static const char __pyx_k_DthetaW_DpsiC[] =
"DthetaW_DpsiC";
1883 static const char __pyx_k_material_left[] =
"material_left";
1884 static const char __pyx_k_weak_residual[] =
"weak_residual";
1885 static const char __pyx_k_material_right[] =
"material_right";
1886 static const char __pyx_k_ebq_global_vals[] =
"ebq_global_vals";
1887 static const char __pyx_k_elementJacobian[] =
"elementJacobian";
1888 static const char __pyx_k_elementResidual[] =
"elementResidual";
1889 static const char __pyx_k_onePlus_pcBar_n[] =
"onePlus_pcBar_n";
1890 static const char __pyx_k_nElements_global[] =
"nElements_global";
1891 static const char __pyx_k_nDOF_test_element[] =
"nDOF_test_element";
1892 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
1893 static const char __pyx_k_material_functions[] =
"material_functions";
1894 static const char __pyx_k_nDOF_trial_element[] =
"nDOF_trial_element";
1895 static const char __pyx_k_updateMass_weakAvg[] =
"updateMass_weakAvg";
1896 static const char __pyx_k_calculateNormalFlux[] =
"calculateNormalFlux";
1897 static const char __pyx_k_thisElementIsUpwind[] =
"thisElementIsUpwind";
1898 static const char __pyx_k_elementBoundaryTypes[] =
"elementBoundaryTypes";
1899 static const char __pyx_k_elementMaterialTypes[] =
"elementMaterialTypes";
1900 static const char __pyx_k_elementNeighborsArray[] =
"elementNeighborsArray";
1901 static const char __pyx_k_elementBoundariesArray[] =
"elementBoundariesArray";
1902 static const char __pyx_k_jacobian_weak_residual[] =
"jacobian_weak_residual";
1903 static const char __pyx_k_characteristic_velocity[] =
"characteristic_velocity";
1904 static const char __pyx_k_elementBarycentersArray[] =
"elementBarycentersArray";
1905 static const char __pyx_k_nElementBoundaries_global[] =
"nElementBoundaries_global";
1906 static const char __pyx_k_setElementBoundariesArray[] =
"setElementBoundariesArray";
1907 static const char __pyx_k_RE_NCP1_getElementJacobian[] =
"RE_NCP1_getElementJacobian";
1908 static const char __pyx_k_RE_NCP1_getElementResidual[] =
"RE_NCP1_getElementResidual";
1909 static const char __pyx_k_nElementBoundaries_element[] =
"nElementBoundaries_element";
1910 static const char __pyx_k_updateMassJacobian_weakAvg[] =
"updateMassJacobian_weakAvg";
1911 static const char __pyx_k_vortexElementVelocityEval3[] =
"vortexElementVelocityEval3";
1912 static const char __pyx_k_vortexElementVelocityEval4[] =
"vortexElementVelocityEval4";
1913 static const char __pyx_k_helicalElementVelocityEval3[] =
"helicalElementVelocityEval3";
1914 static const char __pyx_k_helicalElementVelocityEval4[] =
"helicalElementVelocityEval4";
1915 static const char __pyx_k_ndarray_is_not_C_contiguous[] =
"ndarray is not C contiguous";
1916 static const char __pyx_k_characteristic_velocity_dofs[] =
"characteristic_velocity_dofs";
1917 static const char __pyx_k_elementBoundaryElementsArray[] =
"elementBoundaryElementsArray";
1918 static const char __pyx_k_elementBoundaryMaterialTypes[] =
"elementBoundaryMaterialTypes";
1919 static const char __pyx_k_subsurfaceTransportFunctions[] =
"subsurfaceTransportFunctions";
1920 static const char __pyx_k_exteriorElementBoundariesArray[] =
"exteriorElementBoundariesArray";
1921 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
1922 static const char __pyx_k_setExteriorElementBoundaryTypes[] =
"setExteriorElementBoundaryTypes";
1923 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] =
"unknown dtype code in numpy.pxd (%d)";
1924 static const char __pyx_k_Format_string_allocated_too_shor[] =
"Format string allocated too short, see comment in numpy.pxd";
1925 static const char __pyx_k_Non_native_byte_order_not_suppor[] =
"Non-native byte order not supported";
1926 static const char __pyx_k_RE_NCP1_evaluateElementCoefficie[] =
"RE_NCP1_evaluateElementCoefficients_Linear";
1927 static const char __pyx_k_computeSimpleCharacteristicVeloc[] =
"computeSimpleCharacteristicVelocityFromElementVelocity";
1928 static const char __pyx_k_evaluateScalarMaterialFunctionOv[] =
"evaluateScalarMaterialFunctionOverElements";
1929 static const char __pyx_k_evaluateSparseTensorMaterialFunc[] =
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage";
1930 static const char __pyx_k_evaluateVectorMaterialFunctionOv[] =
"evaluateVectorMaterialFunctionOverElements";
1931 static const char __pyx_k_exteriorElementBoundaryMaterialT[] =
"exteriorElementBoundaryMaterialTypes";
1932 static const char __pyx_k_nExteriorElementBoundaries_globa[] =
"nExteriorElementBoundaries_global";
1933 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] =
"ndarray is not Fortran contiguous";
1934 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
1935 static const char __pyx_k_proteus_subsurfaceTransportFunct[] =
"proteus/subsurfaceTransportFunctions.pyx";
1936 static const char __pyx_k_rotatingGaussianElementVelocityE[] =
"rotatingGaussianElementVelocityEval3";
1937 static const char __pyx_k_setScalarMaterialFunctionOverEle[] =
"setScalarMaterialFunctionOverElements";
1938 static const char __pyx_k_setScalarMaterialFunctionOverGlo[] =
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage";
1939 static const char __pyx_k_setSparseTensorMaterialFunctionO[] =
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage";
1940 static const char __pyx_k_setVectorMaterialFunctionOverEle[] =
"setVectorMaterialFunctionOverElements";
1941 static const char __pyx_k_Format_string_allocated_too_shor_2[] =
"Format string allocated too short.";
1942 static const char __pyx_k_RE_NCP1_evaluateElementCoefficie_2[] =
"RE_NCP1_evaluateElementCoefficients_VGM";
1943 static const char __pyx_k_computeSimpleCharacteristicVeloc_2[] =
"computeSimpleCharacteristicVelocityFromVelocityDOFs";
1944 static const char __pyx_k_evaluateScalarMaterialFunctionOv_2[] =
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage";
1945 static const char __pyx_k_evaluateScalarMaterialFunctionOv_3[] =
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage";
1946 static const char __pyx_k_evaluateSparseTensorMaterialFunc_2[] =
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage";
1947 static const char __pyx_k_rotatingGaussianElementVelocityE_2[] =
"rotatingGaussianElementVelocityEval4";
1948 static const char __pyx_k_setScalarMaterialFunctionOverEle_2[] =
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage";
1949 static const char __pyx_k_setSparseTensorMaterialFunctionO_2[] =
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage";
1950 static PyObject *__pyx_n_s_DKWr_DpsiC;
1951 static PyObject *__pyx_n_s_DsBar_DpsiC;
1952 static PyObject *__pyx_n_s_DthetaW_DpsiC;
1953 static PyObject *__pyx_n_s_DvBar_DpsiC;
1954 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
1955 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
1956 static PyObject *__pyx_n_s_I;
1957 static PyObject *__pyx_n_s_ImportError;
1958 static PyObject *__pyx_n_s_J;
1959 static PyObject *__pyx_n_s_KWr;
1960 static PyObject *__pyx_n_s_KWs;
1961 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
1962 static PyObject *__pyx_n_s_RE_NCP1_evaluateElementCoefficie;
1963 static PyObject *__pyx_n_s_RE_NCP1_evaluateElementCoefficie_2;
1964 static PyObject *__pyx_n_s_RE_NCP1_getElementJacobian;
1965 static PyObject *__pyx_n_s_RE_NCP1_getElementResidual;
1966 static PyObject *__pyx_n_s_RuntimeError;
1967 static PyObject *__pyx_n_s_ValueError;
1968 static PyObject *__pyx_n_s_a_avg;
1969 static PyObject *__pyx_n_s_a_eN;
1970 static PyObject *__pyx_n_s_a_neig;
1971 static PyObject *__pyx_n_s_a_up;
1972 static PyObject *__pyx_n_s_alpha;
1973 static PyObject *__pyx_n_s_beta;
1974 static PyObject *__pyx_n_s_calculateNormalFlux;
1975 static PyObject *__pyx_n_s_characteristic_velocity;
1976 static PyObject *__pyx_n_s_characteristic_velocity_dofs;
1977 static PyObject *__pyx_n_s_cline_in_traceback;
1978 static PyObject *__pyx_n_s_clock;
1979 static PyObject *__pyx_n_s_colind;
1980 static PyObject *__pyx_n_s_computeSimpleCharacteristicVeloc;
1981 static PyObject *__pyx_n_s_computeSimpleCharacteristicVeloc_2;
1982 static PyObject *__pyx_n_s_d;
1983 static PyObject *__pyx_n_s_dS;
1984 static PyObject *__pyx_n_s_dV;
1985 static PyObject *__pyx_n_s_denom;
1986 static PyObject *__pyx_n_s_df;
1987 static PyObject *__pyx_n_s_df_dofs;
1988 static PyObject *__pyx_n_s_dkr_up;
1989 static PyObject *__pyx_n_s_dm;
1990 static PyObject *__pyx_n_s_dmt;
1991 static PyObject *__pyx_n_s_dmtj_avg;
1992 static PyObject *__pyx_n_s_dot;
1993 static PyObject *__pyx_n_s_drhom;
1994 static PyObject *__pyx_n_s_eN;
1995 static PyObject *__pyx_n_s_eN_left;
1996 static PyObject *__pyx_n_s_eN_neighbor;
1997 static PyObject *__pyx_n_s_eN_right;
1998 static PyObject *__pyx_n_s_ebN;
1999 static PyObject *__pyx_n_s_ebNE;
2000 static PyObject *__pyx_n_s_ebN_local;
2001 static PyObject *__pyx_n_s_ebq_global_vals;
2002 static PyObject *__pyx_n_s_ebq_vals;
2003 static PyObject *__pyx_n_s_elementBarycentersArray;
2004 static PyObject *__pyx_n_s_elementBoundariesArray;
2005 static PyObject *__pyx_n_s_elementBoundaryElementsArray;
2006 static PyObject *__pyx_n_s_elementBoundaryMaterialTypes;
2007 static PyObject *__pyx_n_s_elementBoundaryTypes;
2008 static PyObject *__pyx_n_s_elementJacobian;
2009 static PyObject *__pyx_n_s_elementMaterialTypes;
2010 static PyObject *__pyx_n_s_elementNeighborsArray;
2011 static PyObject *__pyx_n_s_elementResidual;
2012 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv;
2013 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv_2;
2014 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv_3;
2015 static PyObject *__pyx_n_s_evaluateSparseTensorMaterialFunc;
2016 static PyObject *__pyx_n_s_evaluateSparseTensorMaterialFunc_2;
2017 static PyObject *__pyx_n_s_evaluateVectorMaterialFunctionOv;
2018 static PyObject *__pyx_n_s_exteriorElementBoundariesArray;
2019 static PyObject *__pyx_n_s_exteriorElementBoundaryMaterialT;
2020 static PyObject *__pyx_n_s_f_up;
2021 static PyObject *__pyx_n_s_flat;
2022 static PyObject *__pyx_n_s_flux;
2023 static PyObject *__pyx_n_s_gravity;
2024 static PyObject *__pyx_n_s_helicalElementVelocityEval3;
2025 static PyObject *__pyx_n_s_helicalElementVelocityEval4;
2026 static PyObject *__pyx_n_s_i;
2027 static PyObject *__pyx_n_s_ii;
2028 static PyObject *__pyx_n_s_import;
2029 static PyObject *__pyx_n_s_integral;
2030 static PyObject *__pyx_n_s_j;
2031 static PyObject *__pyx_n_s_jacobian_weak_residual;
2032 static PyObject *__pyx_n_s_k;
2033 static PyObject *__pyx_n_s_kb;
2034 static PyObject *__pyx_n_s_kr_eN;
2035 static PyObject *__pyx_n_s_kr_neig;
2036 static PyObject *__pyx_n_s_l2g;
2037 static PyObject *__pyx_n_s_m;
2038 static PyObject *__pyx_n_s_main;
2039 static PyObject *__pyx_n_s_matID;
2040 static PyObject *__pyx_n_s_matID_neig;
2041 static PyObject *__pyx_n_s_material;
2042 static PyObject *__pyx_n_s_material_functions;
2043 static PyObject *__pyx_n_s_material_left;
2044 static PyObject *__pyx_n_s_material_right;
2045 static PyObject *__pyx_n_s_mt;
2046 static PyObject *__pyx_n_s_mt_avg;
2047 static PyObject *__pyx_n_s_n;
2048 static PyObject *__pyx_n_s_nAvgWeight;
2049 static PyObject *__pyx_n_s_nDOF_test_element;
2050 static PyObject *__pyx_n_s_nDOF_trial_element;
2051 static PyObject *__pyx_n_s_nElementBoundaries_element;
2052 static PyObject *__pyx_n_s_nElementBoundaries_global;
2053 static PyObject *__pyx_n_s_nElements_global;
2054 static PyObject *__pyx_n_s_nExteriorElementBoundaries_globa;
2055 static PyObject *__pyx_n_s_nSpace;
2056 static PyObject *__pyx_n_s_nSpace2;
2057 static PyObject *__pyx_n_s_name;
2058 static PyObject *__pyx_n_s_nd;
2059 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2060 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2061 static PyObject *__pyx_n_s_nnz;
2062 static PyObject *__pyx_n_s_numer;
2063 static PyObject *__pyx_n_s_numpy;
2064 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2065 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2066 static PyObject *__pyx_n_s_omega_e;
2067 static PyObject *__pyx_n_s_one8;
2068 static PyObject *__pyx_n_s_onePlus_pcBar_n;
2069 static PyObject *__pyx_n_s_pcBar;
2070 static PyObject *__pyx_n_s_pcBar_n;
2071 static PyObject *__pyx_n_s_pcBar_nM1;
2072 static PyObject *__pyx_n_s_pcBar_nM2;
2073 static PyObject *__pyx_n_s_phi_eN;
2074 static PyObject *__pyx_n_s_phi_neig;
2075 static PyObject *__pyx_n_s_pi;
2076 static PyObject *__pyx_n_s_picard;
2077 static PyObject *__pyx_kp_s_proteus_subsurfaceTransportFunct;
2078 static PyObject *__pyx_n_s_psiC;
2079 static PyObject *__pyx_n_s_q;
2080 static PyObject *__pyx_n_s_q_alin;
2081 static PyObject *__pyx_n_s_q_detJ;
2082 static PyObject *__pyx_n_s_q_dkr;
2083 static PyObject *__pyx_n_s_q_dm;
2084 static PyObject *__pyx_n_s_q_dmass;
2085 static PyObject *__pyx_n_s_q_dmt;
2086 static PyObject *__pyx_n_s_q_flin;
2087 static PyObject *__pyx_n_s_q_grad_u;
2088 static PyObject *__pyx_n_s_q_grad_v;
2089 static PyObject *__pyx_n_s_q_grad_w;
2090 static PyObject *__pyx_n_s_q_kr;
2091 static PyObject *__pyx_n_s_q_kr_up;
2092 static PyObject *__pyx_n_s_q_m;
2093 static PyObject *__pyx_n_s_q_mass;
2094 static PyObject *__pyx_n_s_q_mt;
2095 static PyObject *__pyx_n_s_q_r;
2096 static PyObject *__pyx_n_s_q_u;
2097 static PyObject *__pyx_n_s_q_vals;
2098 static PyObject *__pyx_n_s_q_x;
2099 static PyObject *__pyx_n_s_range;
2100 static PyObject *__pyx_n_s_rho;
2101 static PyObject *__pyx_n_s_rho2;
2102 static PyObject *__pyx_n_s_rhom;
2103 static PyObject *__pyx_n_s_rotatingGaussianElementVelocityE;
2104 static PyObject *__pyx_n_s_rotatingGaussianElementVelocityE_2;
2105 static PyObject *__pyx_n_s_rowptr;
2106 static PyObject *__pyx_n_s_sBar;
2107 static PyObject *__pyx_n_s_setElementBoundariesArray;
2108 static PyObject *__pyx_n_s_setExteriorElementBoundaryTypes;
2109 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverEle;
2110 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverEle_2;
2111 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverGlo;
2112 static PyObject *__pyx_n_s_setSparseTensorMaterialFunctionO;
2113 static PyObject *__pyx_n_s_setSparseTensorMaterialFunctionO_2;
2114 static PyObject *__pyx_n_s_setVectorMaterialFunctionOverEle;
2115 static PyObject *__pyx_n_s_shape;
2116 static PyObject *__pyx_n_s_sqrt_sBar;
2117 static PyObject *__pyx_n_s_subsurfaceTransportFunctions;
2118 static PyObject *__pyx_n_s_sum;
2119 static PyObject *__pyx_n_s_t;
2120 static PyObject *__pyx_n_s_tForReversal;
2121 static PyObject *__pyx_n_s_test;
2122 static PyObject *__pyx_n_s_thetaR;
2123 static PyObject *__pyx_n_s_thetaS;
2124 static PyObject *__pyx_n_s_thetaSR;
2125 static PyObject *__pyx_n_s_thetaW;
2126 static PyObject *__pyx_n_s_thisElementIsUpwind;
2127 static PyObject *__pyx_n_s_transient;
2128 static PyObject *__pyx_n_s_u_dof;
2129 static PyObject *__pyx_n_s_u_eN;
2130 static PyObject *__pyx_n_s_u_j;
2131 static PyObject *__pyx_n_s_u_l2g;
2132 static PyObject *__pyx_n_s_u_neig;
2133 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2134 static PyObject *__pyx_n_s_updateMassJacobian_weakAvg;
2135 static PyObject *__pyx_n_s_updateMass_weakAvg;
2136 static PyObject *__pyx_n_s_upwindFlag;
2137 static PyObject *__pyx_n_s_v;
2138 static PyObject *__pyx_n_s_vBar;
2139 static PyObject *__pyx_n_s_vBar2;
2140 static PyObject *__pyx_n_s_vol;
2141 static PyObject *__pyx_n_s_volFactor;
2142 static PyObject *__pyx_n_s_vol_e;
2143 static PyObject *__pyx_n_s_volume;
2144 static PyObject *__pyx_n_s_vortexElementVelocityEval3;
2145 static PyObject *__pyx_n_s_vortexElementVelocityEval4;
2146 static PyObject *__pyx_n_s_w;
2147 static PyObject *__pyx_n_s_weak_residual;
2148 static PyObject *__pyx_n_s_weight;
2149 static PyObject *__pyx_n_s_x;
2150 static PyObject *__pyx_n_s_xc;
2151 static PyObject *__pyx_n_s_yc;
2152 static PyObject *__pyx_n_s_zVelocity;
2153 static PyObject *__pyx_n_s_zeros;
2154 static PyObject *__pyx_n_s_zvelocity;
2155 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes);
2156 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nElementBoundaries_global, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_elementBoundaryMaterialTypes);
2157 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2158 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2159 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2160 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2161 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2162 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2163 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2164 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2165 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2166 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2167 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2168 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2169 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_KWs,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin);
2170 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho,
double __pyx_v_beta, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_alpha, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_thetaR, PyArrayObject *__pyx_v_thetaSR,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementMaterialTypes,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_u_l2g, PyArrayObject *__pyx_v_u_dof, CYTHON_UNUSED PyArrayObject *__pyx_v_q_x, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_mass, PyArrayObject *__pyx_v_q_dmass, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up);
2171 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementResidual);
2172 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_q_u, CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_grad_v, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_dmt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementJacobian);
2173 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_weak_residual);
2174 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_jacobian_weak_residual);
2175 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_dS, PyArrayObject *__pyx_v_flux);
2176 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_characteristic_velocity, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV);
2177 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df_dofs, PyArrayObject *__pyx_v_characteristic_velocity_dofs, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV);
2178 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity);
2179 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity);
2180 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2181 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2182 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2183 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2184 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2185 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info);
2186 static PyObject *__pyx_float_0_0;
2187 static PyObject *__pyx_float_0_5;
2188 static PyObject *__pyx_float_2_0;
2189 static PyObject *__pyx_float_1_0eneg_20;
2190 static PyObject *__pyx_slice_;
2191 static PyObject *__pyx_tuple__2;
2192 static PyObject *__pyx_tuple__3;
2193 static PyObject *__pyx_tuple__4;
2194 static PyObject *__pyx_tuple__5;
2195 static PyObject *__pyx_tuple__6;
2196 static PyObject *__pyx_tuple__7;
2197 static PyObject *__pyx_tuple__8;
2198 static PyObject *__pyx_tuple__9;
2199 static PyObject *__pyx_tuple__11;
2200 static PyObject *__pyx_tuple__13;
2201 static PyObject *__pyx_tuple__15;
2202 static PyObject *__pyx_tuple__17;
2203 static PyObject *__pyx_tuple__19;
2204 static PyObject *__pyx_tuple__21;
2205 static PyObject *__pyx_tuple__23;
2206 static PyObject *__pyx_tuple__25;
2207 static PyObject *__pyx_tuple__27;
2208 static PyObject *__pyx_tuple__29;
2209 static PyObject *__pyx_tuple__31;
2210 static PyObject *__pyx_tuple__33;
2211 static PyObject *__pyx_tuple__35;
2212 static PyObject *__pyx_tuple__37;
2213 static PyObject *__pyx_tuple__39;
2214 static PyObject *__pyx_tuple__41;
2215 static PyObject *__pyx_tuple__43;
2216 static PyObject *__pyx_tuple__45;
2217 static PyObject *__pyx_tuple__47;
2218 static PyObject *__pyx_tuple__49;
2219 static PyObject *__pyx_tuple__51;
2220 static PyObject *__pyx_tuple__53;
2221 static PyObject *__pyx_tuple__55;
2222 static PyObject *__pyx_tuple__57;
2223 static PyObject *__pyx_tuple__59;
2224 static PyObject *__pyx_tuple__61;
2225 static PyObject *__pyx_tuple__63;
2226 static PyObject *__pyx_tuple__65;
2227 static PyObject *__pyx_codeobj__10;
2228 static PyObject *__pyx_codeobj__12;
2229 static PyObject *__pyx_codeobj__14;
2230 static PyObject *__pyx_codeobj__16;
2231 static PyObject *__pyx_codeobj__18;
2232 static PyObject *__pyx_codeobj__20;
2233 static PyObject *__pyx_codeobj__22;
2234 static PyObject *__pyx_codeobj__24;
2235 static PyObject *__pyx_codeobj__26;
2236 static PyObject *__pyx_codeobj__28;
2237 static PyObject *__pyx_codeobj__30;
2238 static PyObject *__pyx_codeobj__32;
2239 static PyObject *__pyx_codeobj__34;
2240 static PyObject *__pyx_codeobj__36;
2241 static PyObject *__pyx_codeobj__38;
2242 static PyObject *__pyx_codeobj__40;
2243 static PyObject *__pyx_codeobj__42;
2244 static PyObject *__pyx_codeobj__44;
2245 static PyObject *__pyx_codeobj__46;
2246 static PyObject *__pyx_codeobj__48;
2247 static PyObject *__pyx_codeobj__50;
2248 static PyObject *__pyx_codeobj__52;
2249 static PyObject *__pyx_codeobj__54;
2250 static PyObject *__pyx_codeobj__56;
2251 static PyObject *__pyx_codeobj__58;
2252 static PyObject *__pyx_codeobj__60;
2253 static PyObject *__pyx_codeobj__62;
2254 static PyObject *__pyx_codeobj__64;
2255 static PyObject *__pyx_codeobj__66;
2266 static CYTHON_INLINE
double __pyx_f_28subsurfaceTransportFunctions_double_max(
double __pyx_v_a,
double __pyx_v_b) {
2268 __Pyx_RefNannyDeclarations
2270 __Pyx_RefNannySetupContext(
"double_max", 0);
2271 if (((__pyx_v_a >= __pyx_v_b) != 0)) {
2272 __pyx_t_1 = __pyx_v_a;
2274 __pyx_t_1 = __pyx_v_b;
2276 __pyx_r = __pyx_t_1;
2281 __Pyx_RefNannyFinishContext();
2293 static CYTHON_INLINE
double __pyx_f_28subsurfaceTransportFunctions_double_min(
double __pyx_v_a,
double __pyx_v_b) {
2295 __Pyx_RefNannyDeclarations
2297 __Pyx_RefNannySetupContext(
"double_min", 0);
2298 if (((__pyx_v_a <= __pyx_v_b) != 0)) {
2299 __pyx_t_1 = __pyx_v_a;
2301 __pyx_t_1 = __pyx_v_b;
2303 __pyx_r = __pyx_t_1;
2308 __Pyx_RefNannyFinishContext();
2321 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2322 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes = {
"setExteriorElementBoundaryTypes", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes, METH_VARARGS|METH_KEYWORDS, 0};
2323 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2324 int __pyx_v_nExteriorElementBoundaries_global;
2325 PyArrayObject *__pyx_v_exteriorElementBoundariesArray = 0;
2326 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
2327 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2328 PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes = 0;
2329 PyObject *__pyx_r = 0;
2330 __Pyx_RefNannyDeclarations
2331 __Pyx_RefNannySetupContext(
"setExteriorElementBoundaryTypes (wrapper)", 0);
2333 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nExteriorElementBoundaries_globa,&__pyx_n_s_exteriorElementBoundariesArray,&__pyx_n_s_elementBoundaryElementsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_exteriorElementBoundaryMaterialT,0};
2334 PyObject* values[5] = {0,0,0,0,0};
2335 if (unlikely(__pyx_kwds)) {
2337 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2339 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2341 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2343 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2345 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2347 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2350 default:
goto __pyx_L5_argtuple_error;
2352 kw_args = PyDict_Size(__pyx_kwds);
2355 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nExteriorElementBoundaries_globa)) != 0)) kw_args--;
2356 else goto __pyx_L5_argtuple_error;
2359 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exteriorElementBoundariesArray)) != 0)) kw_args--;
2361 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 1); __PYX_ERR(0, 18, __pyx_L3_error)
2365 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryElementsArray)) != 0)) kw_args--;
2367 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 2); __PYX_ERR(0, 18, __pyx_L3_error)
2371 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
2373 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 3); __PYX_ERR(0, 18, __pyx_L3_error)
2377 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exteriorElementBoundaryMaterialT)) != 0)) kw_args--;
2379 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 4); __PYX_ERR(0, 18, __pyx_L3_error)
2382 if (unlikely(kw_args > 0)) {
2383 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setExteriorElementBoundaryTypes") < 0)) __PYX_ERR(0, 18, __pyx_L3_error)
2385 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
2386 goto __pyx_L5_argtuple_error;
2388 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2389 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2390 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2391 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2392 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2394 __pyx_v_nExteriorElementBoundaries_global = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nExteriorElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error)
2395 __pyx_v_exteriorElementBoundariesArray = ((PyArrayObject *)values[1]);
2396 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[2]);
2397 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[3]);
2398 __pyx_v_exteriorElementBoundaryMaterialTypes = ((PyArrayObject *)values[4]);
2400 goto __pyx_L4_argument_unpacking_done;
2401 __pyx_L5_argtuple_error:;
2402 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 18, __pyx_L3_error)
2404 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setExteriorElementBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
2405 __Pyx_RefNannyFinishContext();
2407 __pyx_L4_argument_unpacking_done:;
2408 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"exteriorElementBoundariesArray", 0))) __PYX_ERR(0, 19, __pyx_L1_error)
2409 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryElementsArray", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
2410 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 21, __pyx_L1_error)
2411 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundaryMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"exteriorElementBoundaryMaterialTypes", 0))) __PYX_ERR(0, 22, __pyx_L1_error)
2412 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(__pyx_self, __pyx_v_nExteriorElementBoundaries_global, __pyx_v_exteriorElementBoundariesArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementMaterialTypes, __pyx_v_exteriorElementBoundaryMaterialTypes);
2419 __Pyx_RefNannyFinishContext();
2423 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes) {
2427 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryElementsArray;
2428 __Pyx_Buffer __pyx_pybuffer_elementBoundaryElementsArray;
2429 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
2430 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
2431 __Pyx_LocalBuf_ND __pyx_pybuffernd_exteriorElementBoundariesArray;
2432 __Pyx_Buffer __pyx_pybuffer_exteriorElementBoundariesArray;
2433 __Pyx_LocalBuf_ND __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes;
2434 __Pyx_Buffer __pyx_pybuffer_exteriorElementBoundaryMaterialTypes;
2435 PyObject *__pyx_r = NULL;
2436 __Pyx_RefNannyDeclarations
2440 Py_ssize_t __pyx_t_4;
2442 Py_ssize_t __pyx_t_6;
2443 Py_ssize_t __pyx_t_7;
2444 Py_ssize_t __pyx_t_8;
2445 Py_ssize_t __pyx_t_9;
2446 __Pyx_RefNannySetupContext(
"setExteriorElementBoundaryTypes", 0);
2447 __pyx_pybuffer_exteriorElementBoundariesArray.pybuffer.buf = NULL;
2448 __pyx_pybuffer_exteriorElementBoundariesArray.refcount = 0;
2449 __pyx_pybuffernd_exteriorElementBoundariesArray.data = NULL;
2450 __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer = &__pyx_pybuffer_exteriorElementBoundariesArray;
2451 __pyx_pybuffer_elementBoundaryElementsArray.pybuffer.buf = NULL;
2452 __pyx_pybuffer_elementBoundaryElementsArray.refcount = 0;
2453 __pyx_pybuffernd_elementBoundaryElementsArray.data = NULL;
2454 __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer = &__pyx_pybuffer_elementBoundaryElementsArray;
2455 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
2456 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
2457 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
2458 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
2459 __pyx_pybuffer_exteriorElementBoundaryMaterialTypes.pybuffer.buf = NULL;
2460 __pyx_pybuffer_exteriorElementBoundaryMaterialTypes.refcount = 0;
2461 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.data = NULL;
2462 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer = &__pyx_pybuffer_exteriorElementBoundaryMaterialTypes;
2464 __Pyx_BufFmt_StackElem __pyx_stack[1];
2465 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_exteriorElementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2467 __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.shape[0];
2469 __Pyx_BufFmt_StackElem __pyx_stack[1];
2470 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryElementsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2472 __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[1];
2474 __Pyx_BufFmt_StackElem __pyx_stack[1];
2475 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2477 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
2479 __Pyx_BufFmt_StackElem __pyx_stack[1];
2480 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_exteriorElementBoundaryMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2482 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[0];
2491 __pyx_t_1 = __pyx_v_nExteriorElementBoundaries_global;
2492 __pyx_t_2 = __pyx_t_1;
2493 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
2494 __pyx_v_ebNE = __pyx_t_3;
2503 __pyx_t_4 = __pyx_v_ebNE;
2505 if (__pyx_t_4 < 0) {
2506 __pyx_t_4 += __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape;
2507 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
2508 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape)) __pyx_t_5 = 0;
2509 if (unlikely(__pyx_t_5 != -1)) {
2510 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2511 __PYX_ERR(0, 25, __pyx_L1_error)
2513 __pyx_v_ebN = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].strides));
2522 __pyx_t_6 = __pyx_v_ebN;
2525 if (__pyx_t_6 < 0) {
2526 __pyx_t_6 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2527 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0;
2528 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_5 = 0;
2529 if (__pyx_t_7 < 0) {
2530 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2531 if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 1;
2532 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_5 = 1;
2533 if (unlikely(__pyx_t_5 != -1)) {
2534 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2535 __PYX_ERR(0, 26, __pyx_L1_error)
2537 __pyx_v_eN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2546 __pyx_t_8 = __pyx_v_eN;
2548 if (__pyx_t_8 < 0) {
2549 __pyx_t_8 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2550 if (unlikely(__pyx_t_8 < 0)) __pyx_t_5 = 0;
2551 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2552 if (unlikely(__pyx_t_5 != -1)) {
2553 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2554 __PYX_ERR(0, 27, __pyx_L1_error)
2556 __pyx_t_9 = __pyx_v_ebNE;
2558 if (__pyx_t_9 < 0) {
2559 __pyx_t_9 += __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape;
2560 if (unlikely(__pyx_t_9 < 0)) __pyx_t_5 = 0;
2561 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2562 if (unlikely(__pyx_t_5 != -1)) {
2563 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2564 __PYX_ERR(0, 27, __pyx_L1_error)
2566 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2578 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2581 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2582 __Pyx_PyThreadState_declare
2583 __Pyx_PyThreadState_assign
2584 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2585 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2586 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2587 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer);
2588 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer);
2589 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2590 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setExteriorElementBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
2594 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2595 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2596 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer);
2597 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer);
2599 __Pyx_XGIVEREF(__pyx_r);
2600 __Pyx_RefNannyFinishContext();
2613 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2614 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_3setElementBoundariesArray = {
"setElementBoundariesArray", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray, METH_VARARGS|METH_KEYWORDS, 0};
2615 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2616 int __pyx_v_nElementBoundaries_global;
2617 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
2618 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2619 PyArrayObject *__pyx_v_elementBoundaryMaterialTypes = 0;
2620 PyObject *__pyx_r = 0;
2621 __Pyx_RefNannyDeclarations
2622 __Pyx_RefNannySetupContext(
"setElementBoundariesArray (wrapper)", 0);
2624 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nElementBoundaries_global,&__pyx_n_s_elementBoundaryElementsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_elementBoundaryMaterialTypes,0};
2625 PyObject* values[4] = {0,0,0,0};
2626 if (unlikely(__pyx_kwds)) {
2628 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2630 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2632 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2634 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2636 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2639 default:
goto __pyx_L5_argtuple_error;
2641 kw_args = PyDict_Size(__pyx_kwds);
2644 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_global)) != 0)) kw_args--;
2645 else goto __pyx_L5_argtuple_error;
2648 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryElementsArray)) != 0)) kw_args--;
2650 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 1); __PYX_ERR(0, 29, __pyx_L3_error)
2654 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
2656 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 2); __PYX_ERR(0, 29, __pyx_L3_error)
2660 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryMaterialTypes)) != 0)) kw_args--;
2662 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 3); __PYX_ERR(0, 29, __pyx_L3_error)
2665 if (unlikely(kw_args > 0)) {
2666 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setElementBoundariesArray") < 0)) __PYX_ERR(0, 29, __pyx_L3_error)
2668 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
2669 goto __pyx_L5_argtuple_error;
2671 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2672 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2673 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2674 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2676 __pyx_v_nElementBoundaries_global = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error)
2677 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[1]);
2678 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[2]);
2679 __pyx_v_elementBoundaryMaterialTypes = ((PyArrayObject *)values[3]);
2681 goto __pyx_L4_argument_unpacking_done;
2682 __pyx_L5_argtuple_error:;
2683 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 29, __pyx_L3_error)
2685 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setElementBoundariesArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
2686 __Pyx_RefNannyFinishContext();
2688 __pyx_L4_argument_unpacking_done:;
2689 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryElementsArray", 0))) __PYX_ERR(0, 30, __pyx_L1_error)
2690 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 31, __pyx_L1_error)
2691 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryMaterialTypes", 0))) __PYX_ERR(0, 32, __pyx_L1_error)
2692 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(__pyx_self, __pyx_v_nElementBoundaries_global, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementMaterialTypes, __pyx_v_elementBoundaryMaterialTypes);
2699 __Pyx_RefNannyFinishContext();
2703 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nElementBoundaries_global, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_elementBoundaryMaterialTypes) {
2705 int __pyx_v_eN_left;
2706 int __pyx_v_eN_right;
2707 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryElementsArray;
2708 __Pyx_Buffer __pyx_pybuffer_elementBoundaryElementsArray;
2709 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryMaterialTypes;
2710 __Pyx_Buffer __pyx_pybuffer_elementBoundaryMaterialTypes;
2711 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
2712 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
2713 PyObject *__pyx_r = NULL;
2714 __Pyx_RefNannyDeclarations
2718 Py_ssize_t __pyx_t_4;
2719 Py_ssize_t __pyx_t_5;
2721 Py_ssize_t __pyx_t_7;
2722 Py_ssize_t __pyx_t_8;
2723 Py_ssize_t __pyx_t_9;
2724 Py_ssize_t __pyx_t_10;
2725 Py_ssize_t __pyx_t_11;
2726 Py_ssize_t __pyx_t_12;
2727 Py_ssize_t __pyx_t_13;
2728 Py_ssize_t __pyx_t_14;
2730 Py_ssize_t __pyx_t_16;
2731 Py_ssize_t __pyx_t_17;
2732 Py_ssize_t __pyx_t_18;
2733 __Pyx_RefNannySetupContext(
"setElementBoundariesArray", 0);
2734 __pyx_pybuffer_elementBoundaryElementsArray.pybuffer.buf = NULL;
2735 __pyx_pybuffer_elementBoundaryElementsArray.refcount = 0;
2736 __pyx_pybuffernd_elementBoundaryElementsArray.data = NULL;
2737 __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer = &__pyx_pybuffer_elementBoundaryElementsArray;
2738 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
2739 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
2740 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
2741 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
2742 __pyx_pybuffer_elementBoundaryMaterialTypes.pybuffer.buf = NULL;
2743 __pyx_pybuffer_elementBoundaryMaterialTypes.refcount = 0;
2744 __pyx_pybuffernd_elementBoundaryMaterialTypes.data = NULL;
2745 __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryMaterialTypes;
2747 __Pyx_BufFmt_StackElem __pyx_stack[1];
2748 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryElementsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2750 __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[1];
2752 __Pyx_BufFmt_StackElem __pyx_stack[1];
2753 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2755 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
2757 __Pyx_BufFmt_StackElem __pyx_stack[1];
2758 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2760 __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[1];
2769 __pyx_t_1 = __pyx_v_nElementBoundaries_global;
2770 __pyx_t_2 = __pyx_t_1;
2771 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
2772 __pyx_v_ebN = __pyx_t_3;
2781 __pyx_t_4 = __pyx_v_ebN;
2784 if (__pyx_t_4 < 0) {
2785 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2786 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
2787 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_6 = 0;
2788 if (__pyx_t_5 < 0) {
2789 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2790 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
2791 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_6 = 1;
2792 if (unlikely(__pyx_t_6 != -1)) {
2793 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2794 __PYX_ERR(0, 35, __pyx_L1_error)
2796 __pyx_v_eN_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2805 __pyx_t_7 = __pyx_v_ebN;
2808 if (__pyx_t_7 < 0) {
2809 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2810 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 0;
2811 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_6 = 0;
2812 if (__pyx_t_8 < 0) {
2813 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2814 if (unlikely(__pyx_t_8 < 0)) __pyx_t_6 = 1;
2815 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_6 = 1;
2816 if (unlikely(__pyx_t_6 != -1)) {
2817 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2818 __PYX_ERR(0, 36, __pyx_L1_error)
2820 __pyx_v_eN_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2829 __pyx_t_9 = __pyx_v_eN_left;
2831 if (__pyx_t_9 < 0) {
2832 __pyx_t_9 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2833 if (unlikely(__pyx_t_9 < 0)) __pyx_t_6 = 0;
2834 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2835 if (unlikely(__pyx_t_6 != -1)) {
2836 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2837 __PYX_ERR(0, 37, __pyx_L1_error)
2839 __pyx_t_10 = __pyx_v_ebN;
2842 if (__pyx_t_10 < 0) {
2843 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2844 if (unlikely(__pyx_t_10 < 0)) __pyx_t_6 = 0;
2845 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2846 if (__pyx_t_11 < 0) {
2847 __pyx_t_11 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2848 if (unlikely(__pyx_t_11 < 0)) __pyx_t_6 = 1;
2849 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_6 = 1;
2850 if (unlikely(__pyx_t_6 != -1)) {
2851 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2852 __PYX_ERR(0, 37, __pyx_L1_error)
2854 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2863 __pyx_t_12 = __pyx_v_eN_left;
2865 if (__pyx_t_12 < 0) {
2866 __pyx_t_12 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2867 if (unlikely(__pyx_t_12 < 0)) __pyx_t_6 = 0;
2868 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2869 if (unlikely(__pyx_t_6 != -1)) {
2870 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2871 __PYX_ERR(0, 38, __pyx_L1_error)
2873 __pyx_t_13 = __pyx_v_ebN;
2876 if (__pyx_t_13 < 0) {
2877 __pyx_t_13 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2878 if (unlikely(__pyx_t_13 < 0)) __pyx_t_6 = 0;
2879 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2880 if (__pyx_t_14 < 0) {
2881 __pyx_t_14 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2882 if (unlikely(__pyx_t_14 < 0)) __pyx_t_6 = 1;
2883 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_6 = 1;
2884 if (unlikely(__pyx_t_6 != -1)) {
2885 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2886 __PYX_ERR(0, 38, __pyx_L1_error)
2888 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2897 __pyx_t_15 = ((__pyx_v_eN_right >= 0) != 0);
2907 __pyx_t_16 = __pyx_v_eN_right;
2909 if (__pyx_t_16 < 0) {
2910 __pyx_t_16 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2911 if (unlikely(__pyx_t_16 < 0)) __pyx_t_6 = 0;
2912 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2913 if (unlikely(__pyx_t_6 != -1)) {
2914 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2915 __PYX_ERR(0, 40, __pyx_L1_error)
2917 __pyx_t_17 = __pyx_v_ebN;
2920 if (__pyx_t_17 < 0) {
2921 __pyx_t_17 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2922 if (unlikely(__pyx_t_17 < 0)) __pyx_t_6 = 0;
2923 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2924 if (__pyx_t_18 < 0) {
2925 __pyx_t_18 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2926 if (unlikely(__pyx_t_18 < 0)) __pyx_t_6 = 1;
2927 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_6 = 1;
2928 if (unlikely(__pyx_t_6 != -1)) {
2929 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2930 __PYX_ERR(0, 40, __pyx_L1_error)
2932 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2953 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2956 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2957 __Pyx_PyThreadState_declare
2958 __Pyx_PyThreadState_assign
2959 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2960 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2961 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer);
2962 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2963 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2964 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setElementBoundariesArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
2968 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2969 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer);
2970 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2972 __Pyx_XGIVEREF(__pyx_r);
2973 __Pyx_RefNannyFinishContext();
2986 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2987 static char __pyx_doc_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements[] =
"\n loop over quadrature array and set is material j\n likely little improvement right now without correct typing of material_functions\n ";
2988 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements = {
"setScalarMaterialFunctionOverElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements};
2989 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2990 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2991 PyArrayObject *__pyx_v_q_vals = 0;
2992 PyObject *__pyx_v_material_functions = 0;
2993 PyObject *__pyx_r = 0;
2994 __Pyx_RefNannyDeclarations
2995 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElements (wrapper)", 0);
2997 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
2998 PyObject* values[3] = {0,0,0};
2999 if (unlikely(__pyx_kwds)) {
3001 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3003 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3005 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3007 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3010 default:
goto __pyx_L5_argtuple_error;
3012 kw_args = PyDict_Size(__pyx_kwds);
3015 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
3016 else goto __pyx_L5_argtuple_error;
3019 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
3021 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, 1); __PYX_ERR(0, 43, __pyx_L3_error)
3025 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3027 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, 2); __PYX_ERR(0, 43, __pyx_L3_error)
3030 if (unlikely(kw_args > 0)) {
3031 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 43, __pyx_L3_error)
3033 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3034 goto __pyx_L5_argtuple_error;
3036 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3037 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3038 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3040 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[0]);
3041 __pyx_v_q_vals = ((PyArrayObject *)values[1]);
3042 __pyx_v_material_functions = ((PyObject*)values[2]);
3044 goto __pyx_L4_argument_unpacking_done;
3045 __pyx_L5_argtuple_error:;
3046 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 43, __pyx_L3_error)
3048 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3049 __Pyx_RefNannyFinishContext();
3051 __pyx_L4_argument_unpacking_done:;
3052 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 43, __pyx_L1_error)
3053 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 44, __pyx_L1_error)
3054 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 45, __pyx_L1_error)
3055 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(__pyx_self, __pyx_v_elementMaterialTypes, __pyx_v_q_vals, __pyx_v_material_functions);
3062 __Pyx_RefNannyFinishContext();
3066 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
3069 int __pyx_v_material;
3070 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
3071 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
3072 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
3073 __Pyx_Buffer __pyx_pybuffer_q_vals;
3074 PyObject *__pyx_r = NULL;
3075 __Pyx_RefNannyDeclarations
3079 Py_ssize_t __pyx_t_4;
3083 PyObject *__pyx_t_8 = NULL;
3084 PyObject *__pyx_t_9 = NULL;
3085 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_10;
3086 Py_ssize_t __pyx_t_11;
3087 Py_ssize_t __pyx_t_12;
3089 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElements", 0);
3090 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
3091 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
3092 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
3093 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
3094 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
3095 __pyx_pybuffer_q_vals.refcount = 0;
3096 __pyx_pybuffernd_q_vals.data = NULL;
3097 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
3099 __Pyx_BufFmt_StackElem __pyx_stack[1];
3100 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 43, __pyx_L1_error)
3102 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
3104 __Pyx_BufFmt_StackElem __pyx_stack[1];
3105 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 43, __pyx_L1_error)
3107 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1];
3116 __pyx_t_1 = (__pyx_v_q_vals->dimensions[0]);
3117 __pyx_t_2 = __pyx_t_1;
3118 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
3119 __pyx_v_eN = __pyx_t_3;
3128 __pyx_t_4 = __pyx_v_eN;
3130 if (__pyx_t_4 < 0) {
3131 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
3132 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
3133 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
3134 if (unlikely(__pyx_t_5 != -1)) {
3135 __Pyx_RaiseBufferIndexError(__pyx_t_5);
3136 __PYX_ERR(0, 52, __pyx_L1_error)
3138 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
3147 __pyx_t_6 = (__pyx_v_q_vals->dimensions[1]);
3148 __pyx_t_7 = __pyx_t_6;
3149 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
3150 __pyx_v_k = __pyx_t_5;
3159 if (unlikely(__pyx_v_material_functions == Py_None)) {
3160 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3161 __PYX_ERR(0, 54, __pyx_L1_error)
3163 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 54, __pyx_L1_error)
3164 __Pyx_GOTREF(__pyx_t_8);
3165 __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 54, __pyx_L1_error)
3166 __Pyx_GOTREF(__pyx_t_9);
3167 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3168 __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_9);
if (unlikely((__pyx_t_10 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error)
3169 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3170 __pyx_t_11 = __pyx_v_eN;
3171 __pyx_t_12 = __pyx_v_k;
3173 if (__pyx_t_11 < 0) {
3174 __pyx_t_11 += __pyx_pybuffernd_q_vals.diminfo[0].shape;
3175 if (unlikely(__pyx_t_11 < 0)) __pyx_t_13 = 0;
3176 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_vals.diminfo[0].shape)) __pyx_t_13 = 0;
3177 if (__pyx_t_12 < 0) {
3178 __pyx_t_12 += __pyx_pybuffernd_q_vals.diminfo[1].shape;
3179 if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 1;
3180 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_q_vals.diminfo[1].shape)) __pyx_t_13 = 1;
3181 if (unlikely(__pyx_t_13 != -1)) {
3182 __Pyx_RaiseBufferIndexError(__pyx_t_13);
3183 __PYX_ERR(0, 54, __pyx_L1_error)
3185 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_q_vals.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_q_vals.diminfo[1].strides) = __pyx_t_10;
3198 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3201 __Pyx_XDECREF(__pyx_t_8);
3202 __Pyx_XDECREF(__pyx_t_9);
3203 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3204 __Pyx_PyThreadState_declare
3205 __Pyx_PyThreadState_assign
3206 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3207 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3208 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3209 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3210 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3214 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3215 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3217 __Pyx_XGIVEREF(__pyx_r);
3218 __Pyx_RefNannyFinishContext();
3231 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3232 static char __pyx_doc_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements[] =
"\n loop over quadrature array and set \013ec f_j assuming element is material j\n ";
3233 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements = {
"setVectorMaterialFunctionOverElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements};
3234 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3235 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
3236 PyArrayObject *__pyx_v_q_vals = 0;
3237 PyObject *__pyx_v_material_functions = 0;
3238 PyObject *__pyx_r = 0;
3239 __Pyx_RefNannyDeclarations
3240 __Pyx_RefNannySetupContext(
"setVectorMaterialFunctionOverElements (wrapper)", 0);
3242 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
3243 PyObject* values[3] = {0,0,0};
3244 if (unlikely(__pyx_kwds)) {
3246 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3248 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3250 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3252 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3255 default:
goto __pyx_L5_argtuple_error;
3257 kw_args = PyDict_Size(__pyx_kwds);
3260 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
3261 else goto __pyx_L5_argtuple_error;
3264 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
3266 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, 1); __PYX_ERR(0, 56, __pyx_L3_error)
3270 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3272 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, 2); __PYX_ERR(0, 56, __pyx_L3_error)
3275 if (unlikely(kw_args > 0)) {
3276 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setVectorMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 56, __pyx_L3_error)
3278 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3279 goto __pyx_L5_argtuple_error;
3281 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3282 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3283 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3285 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[0]);
3286 __pyx_v_q_vals = ((PyArrayObject *)values[1]);
3287 __pyx_v_material_functions = ((PyObject*)values[2]);
3289 goto __pyx_L4_argument_unpacking_done;
3290 __pyx_L5_argtuple_error:;
3291 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 56, __pyx_L3_error)
3293 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3294 __Pyx_RefNannyFinishContext();
3296 __pyx_L4_argument_unpacking_done:;
3297 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 56, __pyx_L1_error)
3298 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 57, __pyx_L1_error)
3299 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 58, __pyx_L1_error)
3300 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(__pyx_self, __pyx_v_elementMaterialTypes, __pyx_v_q_vals, __pyx_v_material_functions);
3307 __Pyx_RefNannyFinishContext();
3311 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
3314 int __pyx_v_material;
3315 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
3316 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
3317 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
3318 __Pyx_Buffer __pyx_pybuffer_q_vals;
3319 PyObject *__pyx_r = NULL;
3320 __Pyx_RefNannyDeclarations
3324 Py_ssize_t __pyx_t_4;
3328 PyObject *__pyx_t_8 = NULL;
3329 PyObject *__pyx_t_9 = NULL;
3330 PyObject *__pyx_t_10 = NULL;
3331 PyObject *__pyx_t_11 = NULL;
3332 __Pyx_RefNannySetupContext(
"setVectorMaterialFunctionOverElements", 0);
3333 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
3334 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
3335 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
3336 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
3337 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
3338 __pyx_pybuffer_q_vals.refcount = 0;
3339 __pyx_pybuffernd_q_vals.data = NULL;
3340 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
3342 __Pyx_BufFmt_StackElem __pyx_stack[1];
3343 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 56, __pyx_L1_error)
3345 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
3347 __Pyx_BufFmt_StackElem __pyx_stack[1];
3348 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 56, __pyx_L1_error)
3350 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_vals.diminfo[2].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_vals.diminfo[2].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[2];
3359 __pyx_t_1 = (__pyx_v_q_vals->dimensions[0]);
3360 __pyx_t_2 = __pyx_t_1;
3361 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
3362 __pyx_v_eN = __pyx_t_3;
3371 __pyx_t_4 = __pyx_v_eN;
3373 if (__pyx_t_4 < 0) {
3374 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
3375 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
3376 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
3377 if (unlikely(__pyx_t_5 != -1)) {
3378 __Pyx_RaiseBufferIndexError(__pyx_t_5);
3379 __PYX_ERR(0, 64, __pyx_L1_error)
3381 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
3390 __pyx_t_6 = (__pyx_v_q_vals->dimensions[1]);
3391 __pyx_t_7 = __pyx_t_6;
3392 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
3393 __pyx_v_k = __pyx_t_5;
3402 if (unlikely(__pyx_v_material_functions == Py_None)) {
3403 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3404 __PYX_ERR(0, 66, __pyx_L1_error)
3406 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L1_error)
3407 __Pyx_GOTREF(__pyx_t_8);
3408 __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error)
3409 __Pyx_GOTREF(__pyx_t_9);
3410 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3411 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_flat);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L1_error)
3412 __Pyx_GOTREF(__pyx_t_8);
3413 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3414 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error)
3415 __Pyx_GOTREF(__pyx_t_9);
3416 __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error)
3417 __Pyx_GOTREF(__pyx_t_10);
3418 __pyx_t_11 = PyTuple_New(3);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 66, __pyx_L1_error)
3419 __Pyx_GOTREF(__pyx_t_11);
3420 __Pyx_GIVEREF(__pyx_t_9);
3421 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
3422 __Pyx_GIVEREF(__pyx_t_10);
3423 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
3424 __Pyx_INCREF(__pyx_slice_);
3425 __Pyx_GIVEREF(__pyx_slice_);
3426 PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_slice_);
3429 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_q_vals), __pyx_t_11, __pyx_t_8) < 0)) __PYX_ERR(0, 66, __pyx_L1_error)
3430 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3431 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3444 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3447 __Pyx_XDECREF(__pyx_t_8);
3448 __Pyx_XDECREF(__pyx_t_9);
3449 __Pyx_XDECREF(__pyx_t_10);
3450 __Pyx_XDECREF(__pyx_t_11);
3451 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3452 __Pyx_PyThreadState_declare
3453 __Pyx_PyThreadState_assign
3454 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3455 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3456 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3457 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3458 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3462 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3463 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3465 __Pyx_XGIVEREF(__pyx_r);
3466 __Pyx_RefNannyFinishContext();
3479 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3480 static char __pyx_doc_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and set f = 0.5(f^L_j+f^R_k) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
3481 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage = {
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage};
3482 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3483 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
3484 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
3485 PyArrayObject *__pyx_v_ebq_vals = 0;
3486 PyObject *__pyx_v_material_functions = 0;
3487 PyObject *__pyx_r = 0;
3488 __Pyx_RefNannyDeclarations
3489 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage (wrapper)", 0);
3491 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
3492 PyObject* values[4] = {0,0,0,0};
3493 if (unlikely(__pyx_kwds)) {
3495 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3497 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3499 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3501 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3503 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3506 default:
goto __pyx_L5_argtuple_error;
3508 kw_args = PyDict_Size(__pyx_kwds);
3511 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
3512 else goto __pyx_L5_argtuple_error;
3515 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
3517 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 1); __PYX_ERR(0, 69, __pyx_L3_error)
3521 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
3523 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 2); __PYX_ERR(0, 69, __pyx_L3_error)
3527 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3529 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 3); __PYX_ERR(0, 69, __pyx_L3_error)
3532 if (unlikely(kw_args > 0)) {
3533 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 69, __pyx_L3_error)
3535 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3536 goto __pyx_L5_argtuple_error;
3538 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3539 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3540 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3541 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3543 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[0]);
3544 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[1]);
3545 __pyx_v_ebq_vals = ((PyArrayObject *)values[2]);
3546 __pyx_v_material_functions = ((PyObject*)values[3]);
3548 goto __pyx_L4_argument_unpacking_done;
3549 __pyx_L5_argtuple_error:;
3550 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 69, __pyx_L3_error)
3552 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3553 __Pyx_RefNannyFinishContext();
3555 __pyx_L4_argument_unpacking_done:;
3556 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 69, __pyx_L1_error)
3557 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 70, __pyx_L1_error)
3558 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 71, __pyx_L1_error)
3559 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 72, __pyx_L1_error)
3560 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_vals, __pyx_v_material_functions);
3567 __Pyx_RefNannyFinishContext();
3571 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
3574 int __pyx_v_ebN_local;
3576 int __pyx_v_material_left;
3577 int __pyx_v_material_right;
3578 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
3579 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
3580 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
3581 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
3582 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
3583 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
3584 PyObject *__pyx_r = NULL;
3585 __Pyx_RefNannyDeclarations
3592 Py_ssize_t __pyx_t_7;
3593 Py_ssize_t __pyx_t_8;
3595 Py_ssize_t __pyx_t_10;
3596 Py_ssize_t __pyx_t_11;
3597 Py_ssize_t __pyx_t_12;
3598 Py_ssize_t __pyx_t_13;
3599 npy_intp __pyx_t_14;
3600 npy_intp __pyx_t_15;
3601 PyObject *__pyx_t_16 = NULL;
3602 PyObject *__pyx_t_17 = NULL;
3603 PyObject *__pyx_t_18 = NULL;
3604 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_19;
3605 Py_ssize_t __pyx_t_20;
3606 Py_ssize_t __pyx_t_21;
3607 Py_ssize_t __pyx_t_22;
3609 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 0);
3610 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
3611 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
3612 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
3613 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
3614 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
3615 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
3616 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
3617 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
3618 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
3619 __pyx_pybuffer_ebq_vals.refcount = 0;
3620 __pyx_pybuffernd_ebq_vals.data = NULL;
3621 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
3623 __Pyx_BufFmt_StackElem __pyx_stack[1];
3624 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
3626 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
3628 __Pyx_BufFmt_StackElem __pyx_stack[1];
3629 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
3631 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
3633 __Pyx_BufFmt_StackElem __pyx_stack[1];
3634 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
3636 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2];
3645 __pyx_t_1 = (__pyx_v_ebq_vals->dimensions[0]);
3646 __pyx_t_2 = __pyx_t_1;
3647 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
3648 __pyx_v_eN = __pyx_t_3;
3657 __pyx_t_4 = (__pyx_v_ebq_vals->dimensions[1]);
3658 __pyx_t_5 = __pyx_t_4;
3659 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
3660 __pyx_v_ebN_local = __pyx_t_6;
3669 __pyx_t_7 = __pyx_v_eN;
3670 __pyx_t_8 = __pyx_v_ebN_local;
3672 if (__pyx_t_7 < 0) {
3673 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
3674 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
3675 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
3676 if (__pyx_t_8 < 0) {
3677 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
3678 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
3679 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
3680 if (unlikely(__pyx_t_9 != -1)) {
3681 __Pyx_RaiseBufferIndexError(__pyx_t_9);
3682 __PYX_ERR(0, 84, __pyx_L1_error)
3684 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
3693 __pyx_t_10 = __pyx_v_ebN;
3696 if (__pyx_t_10 < 0) {
3697 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3698 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
3699 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
3700 if (__pyx_t_11 < 0) {
3701 __pyx_t_11 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
3702 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
3703 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
3704 if (unlikely(__pyx_t_9 != -1)) {
3705 __Pyx_RaiseBufferIndexError(__pyx_t_9);
3706 __PYX_ERR(0, 85, __pyx_L1_error)
3708 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
3717 __pyx_t_12 = __pyx_v_ebN;
3720 if (__pyx_t_12 < 0) {
3721 __pyx_t_12 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3722 if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 0;
3723 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
3724 if (__pyx_t_13 < 0) {
3725 __pyx_t_13 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
3726 if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 1;
3727 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
3728 if (unlikely(__pyx_t_9 != -1)) {
3729 __Pyx_RaiseBufferIndexError(__pyx_t_9);
3730 __PYX_ERR(0, 86, __pyx_L1_error)
3732 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
3741 __pyx_t_14 = (__pyx_v_ebq_vals->dimensions[2]);
3742 __pyx_t_15 = __pyx_t_14;
3743 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_15; __pyx_t_9+=1) {
3744 __pyx_v_k = __pyx_t_9;
3753 if (unlikely(__pyx_v_material_functions == Py_None)) {
3754 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3755 __PYX_ERR(0, 88, __pyx_L1_error)
3757 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 88, __pyx_L1_error)
3758 __Pyx_GOTREF(__pyx_t_16);
3759 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_16);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 88, __pyx_L1_error)
3760 __Pyx_GOTREF(__pyx_t_17);
3761 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3770 if (unlikely(__pyx_v_material_functions == Py_None)) {
3771 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3772 __PYX_ERR(0, 89, __pyx_L1_error)
3774 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 89, __pyx_L1_error)
3775 __Pyx_GOTREF(__pyx_t_16);
3776 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 89, __pyx_L1_error)
3777 __Pyx_GOTREF(__pyx_t_18);
3778 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3787 __pyx_t_16 = PyNumber_Add(__pyx_t_17, __pyx_t_18);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 88, __pyx_L1_error)
3788 __Pyx_GOTREF(__pyx_t_16);
3789 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3790 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
3791 __pyx_t_18 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 88, __pyx_L1_error)
3792 __Pyx_GOTREF(__pyx_t_18);
3793 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3794 __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_18);
if (unlikely((__pyx_t_19 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error)
3795 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
3796 __pyx_t_20 = __pyx_v_eN;
3797 __pyx_t_21 = __pyx_v_ebN_local;
3798 __pyx_t_22 = __pyx_v_k;
3800 if (__pyx_t_20 < 0) {
3801 __pyx_t_20 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
3802 if (unlikely(__pyx_t_20 < 0)) __pyx_t_23 = 0;
3803 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_23 = 0;
3804 if (__pyx_t_21 < 0) {
3805 __pyx_t_21 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
3806 if (unlikely(__pyx_t_21 < 0)) __pyx_t_23 = 1;
3807 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_23 = 1;
3808 if (__pyx_t_22 < 0) {
3809 __pyx_t_22 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
3810 if (unlikely(__pyx_t_22 < 0)) __pyx_t_23 = 2;
3811 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_23 = 2;
3812 if (unlikely(__pyx_t_23 != -1)) {
3813 __Pyx_RaiseBufferIndexError(__pyx_t_23);
3814 __PYX_ERR(0, 88, __pyx_L1_error)
3816 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_ebq_vals.diminfo[2].strides) = __pyx_t_19;
3830 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3833 __Pyx_XDECREF(__pyx_t_16);
3834 __Pyx_XDECREF(__pyx_t_17);
3835 __Pyx_XDECREF(__pyx_t_18);
3836 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3837 __Pyx_PyThreadState_declare
3838 __Pyx_PyThreadState_assign
3839 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3840 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
3841 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
3842 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
3843 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3844 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3848 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
3849 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
3850 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
3852 __Pyx_XGIVEREF(__pyx_r);
3853 __Pyx_RefNannyFinishContext();
3866 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3867 static char __pyx_doc_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn} = f^L_{j,mn} f^R_{k,mn}/(f^L_{j,mn}+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
3868 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage = {
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage};
3869 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3871 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
3872 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
3873 PyArrayObject *__pyx_v_ebq_vals = 0;
3874 PyObject *__pyx_v_material_functions = 0;
3875 PyObject *__pyx_r = 0;
3876 __Pyx_RefNannyDeclarations
3877 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage (wrapper)", 0);
3879 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
3880 PyObject* values[5] = {0,0,0,0,0};
3881 if (unlikely(__pyx_kwds)) {
3883 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3885 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3887 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3889 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3891 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3893 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3896 default:
goto __pyx_L5_argtuple_error;
3898 kw_args = PyDict_Size(__pyx_kwds);
3901 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
3902 else goto __pyx_L5_argtuple_error;
3905 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
3907 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 1); __PYX_ERR(0, 91, __pyx_L3_error)
3911 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
3913 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 2); __PYX_ERR(0, 91, __pyx_L3_error)
3917 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
3919 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 3); __PYX_ERR(0, 91, __pyx_L3_error)
3923 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3925 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 4); __PYX_ERR(0, 91, __pyx_L3_error)
3928 if (unlikely(kw_args > 0)) {
3929 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 91, __pyx_L3_error)
3931 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
3932 goto __pyx_L5_argtuple_error;
3934 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3935 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3936 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3937 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3938 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3940 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error)
3941 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
3942 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
3943 __pyx_v_ebq_vals = ((PyArrayObject *)values[3]);
3944 __pyx_v_material_functions = ((PyObject*)values[4]);
3946 goto __pyx_L4_argument_unpacking_done;
3947 __pyx_L5_argtuple_error:;
3948 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 91, __pyx_L3_error)
3950 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3951 __Pyx_RefNannyFinishContext();
3953 __pyx_L4_argument_unpacking_done:;
3954 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 92, __pyx_L1_error)
3955 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 93, __pyx_L1_error)
3956 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 94, __pyx_L1_error)
3957 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 95, __pyx_L1_error)
3958 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_vals, __pyx_v_material_functions);
3965 __Pyx_RefNannyFinishContext();
3969 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
3972 int __pyx_v_ebN_local;
3974 int __pyx_v_material_left;
3975 int __pyx_v_material_right;
3978 double __pyx_v_numer;
3979 double __pyx_v_denom;
3980 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
3981 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
3982 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
3983 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
3984 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
3985 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
3986 PyObject *__pyx_r = NULL;
3987 __Pyx_RefNannyDeclarations
3994 Py_ssize_t __pyx_t_7;
3995 Py_ssize_t __pyx_t_8;
3997 Py_ssize_t __pyx_t_10;
3998 Py_ssize_t __pyx_t_11;
3999 Py_ssize_t __pyx_t_12;
4000 Py_ssize_t __pyx_t_13;
4001 npy_intp __pyx_t_14;
4002 npy_intp __pyx_t_15;
4009 PyObject *__pyx_t_22 = NULL;
4010 PyObject *__pyx_t_23 = NULL;
4011 PyObject *__pyx_t_24 = NULL;
4012 PyObject *__pyx_t_25 = NULL;
4013 PyObject *__pyx_t_26 = NULL;
4015 Py_ssize_t __pyx_t_28;
4016 Py_ssize_t __pyx_t_29;
4017 Py_ssize_t __pyx_t_30;
4018 Py_ssize_t __pyx_t_31;
4020 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 0);
4021 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
4022 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
4023 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
4024 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
4025 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
4026 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
4027 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
4028 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
4029 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
4030 __pyx_pybuffer_ebq_vals.refcount = 0;
4031 __pyx_pybuffernd_ebq_vals.data = NULL;
4032 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
4034 __Pyx_BufFmt_StackElem __pyx_stack[1];
4035 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 91, __pyx_L1_error)
4037 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
4039 __Pyx_BufFmt_StackElem __pyx_stack[1];
4040 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 91, __pyx_L1_error)
4042 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
4044 __Pyx_BufFmt_StackElem __pyx_stack[1];
4045 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 91, __pyx_L1_error)
4047 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_ebq_vals.diminfo[3].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_ebq_vals.diminfo[3].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[3];
4056 __pyx_t_1 = (__pyx_v_ebq_vals->dimensions[0]);
4057 __pyx_t_2 = __pyx_t_1;
4058 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4059 __pyx_v_eN = __pyx_t_3;
4068 __pyx_t_4 = (__pyx_v_ebq_vals->dimensions[1]);
4069 __pyx_t_5 = __pyx_t_4;
4070 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
4071 __pyx_v_ebN_local = __pyx_t_6;
4080 __pyx_t_7 = __pyx_v_eN;
4081 __pyx_t_8 = __pyx_v_ebN_local;
4083 if (__pyx_t_7 < 0) {
4084 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
4085 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
4086 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
4087 if (__pyx_t_8 < 0) {
4088 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
4089 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
4090 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
4091 if (unlikely(__pyx_t_9 != -1)) {
4092 __Pyx_RaiseBufferIndexError(__pyx_t_9);
4093 __PYX_ERR(0, 108, __pyx_L1_error)
4095 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
4104 __pyx_t_10 = __pyx_v_ebN;
4107 if (__pyx_t_10 < 0) {
4108 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4109 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
4110 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
4111 if (__pyx_t_11 < 0) {
4112 __pyx_t_11 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4113 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
4114 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
4115 if (unlikely(__pyx_t_9 != -1)) {
4116 __Pyx_RaiseBufferIndexError(__pyx_t_9);
4117 __PYX_ERR(0, 109, __pyx_L1_error)
4119 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4128 __pyx_t_12 = __pyx_v_ebN;
4131 if (__pyx_t_12 < 0) {
4132 __pyx_t_12 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4133 if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 0;
4134 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
4135 if (__pyx_t_13 < 0) {
4136 __pyx_t_13 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4137 if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 1;
4138 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
4139 if (unlikely(__pyx_t_9 != -1)) {
4140 __Pyx_RaiseBufferIndexError(__pyx_t_9);
4141 __PYX_ERR(0, 110, __pyx_L1_error)
4143 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4152 __pyx_t_14 = (__pyx_v_ebq_vals->dimensions[2]);
4153 __pyx_t_15 = __pyx_t_14;
4154 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_15; __pyx_t_9+=1) {
4155 __pyx_v_k = __pyx_t_9;
4164 __pyx_t_16 = __pyx_v_nd;
4165 __pyx_t_17 = __pyx_t_16;
4166 for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
4167 __pyx_v_I = __pyx_t_18;
4176 __pyx_t_19 = __pyx_v_nd;
4177 __pyx_t_20 = __pyx_t_19;
4178 for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
4179 __pyx_v_J = __pyx_t_21;
4188 if (unlikely(__pyx_v_material_functions == Py_None)) {
4189 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4190 __PYX_ERR(0, 114, __pyx_L1_error)
4192 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 114, __pyx_L1_error)
4193 __Pyx_GOTREF(__pyx_t_22);
4194 __pyx_t_23 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_22);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 114, __pyx_L1_error)
4195 __Pyx_GOTREF(__pyx_t_23);
4196 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4197 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 114, __pyx_L1_error)
4198 __Pyx_GOTREF(__pyx_t_22);
4199 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 114, __pyx_L1_error)
4200 __Pyx_GOTREF(__pyx_t_24);
4201 __pyx_t_25 = PyTuple_New(2);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 114, __pyx_L1_error)
4202 __Pyx_GOTREF(__pyx_t_25);
4203 __Pyx_GIVEREF(__pyx_t_22);
4204 PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_22);
4205 __Pyx_GIVEREF(__pyx_t_24);
4206 PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_t_24);
4209 __pyx_t_24 = __Pyx_PyObject_GetItem(__pyx_t_23, __pyx_t_25);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 114, __pyx_L1_error)
4210 __Pyx_GOTREF(__pyx_t_24);
4211 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
4212 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
4213 __pyx_t_25 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_24);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 114, __pyx_L1_error)
4214 __Pyx_GOTREF(__pyx_t_25);
4215 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
4216 if (unlikely(__pyx_v_material_functions == Py_None)) {
4217 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4218 __PYX_ERR(0, 114, __pyx_L1_error)
4220 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 114, __pyx_L1_error)
4221 __Pyx_GOTREF(__pyx_t_24);
4222 __pyx_t_23 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_24);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 114, __pyx_L1_error)
4223 __Pyx_GOTREF(__pyx_t_23);
4224 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
4225 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 114, __pyx_L1_error)
4226 __Pyx_GOTREF(__pyx_t_24);
4227 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 114, __pyx_L1_error)
4228 __Pyx_GOTREF(__pyx_t_22);
4229 __pyx_t_26 = PyTuple_New(2);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 114, __pyx_L1_error)
4230 __Pyx_GOTREF(__pyx_t_26);
4231 __Pyx_GIVEREF(__pyx_t_24);
4232 PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_24);
4233 __Pyx_GIVEREF(__pyx_t_22);
4234 PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_t_22);
4237 __pyx_t_22 = __Pyx_PyObject_GetItem(__pyx_t_23, __pyx_t_26);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 114, __pyx_L1_error)
4238 __Pyx_GOTREF(__pyx_t_22);
4239 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
4240 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
4241 __pyx_t_26 = PyNumber_Multiply(__pyx_t_25, __pyx_t_22);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 114, __pyx_L1_error)
4242 __Pyx_GOTREF(__pyx_t_26);
4243 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
4244 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4245 __pyx_t_27 = __pyx_PyFloat_AsDouble(__pyx_t_26);
if (unlikely((__pyx_t_27 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error)
4246 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
4247 __pyx_v_numer = __pyx_t_27;
4256 if (unlikely(__pyx_v_material_functions == Py_None)) {
4257 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4258 __PYX_ERR(0, 115, __pyx_L1_error)
4260 __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 115, __pyx_L1_error)
4261 __Pyx_GOTREF(__pyx_t_26);
4262 __pyx_t_22 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_26);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
4263 __Pyx_GOTREF(__pyx_t_22);
4264 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
4265 __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 115, __pyx_L1_error)
4266 __Pyx_GOTREF(__pyx_t_26);
4267 __pyx_t_25 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 115, __pyx_L1_error)
4268 __Pyx_GOTREF(__pyx_t_25);
4269 __pyx_t_23 = PyTuple_New(2);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 115, __pyx_L1_error)
4270 __Pyx_GOTREF(__pyx_t_23);
4271 __Pyx_GIVEREF(__pyx_t_26);
4272 PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_26);
4273 __Pyx_GIVEREF(__pyx_t_25);
4274 PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_25);
4277 __pyx_t_25 = __Pyx_PyObject_GetItem(__pyx_t_22, __pyx_t_23);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 115, __pyx_L1_error)
4278 __Pyx_GOTREF(__pyx_t_25);
4279 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4280 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
4281 if (unlikely(__pyx_v_material_functions == Py_None)) {
4282 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4283 __PYX_ERR(0, 115, __pyx_L1_error)
4285 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 115, __pyx_L1_error)
4286 __Pyx_GOTREF(__pyx_t_23);
4287 __pyx_t_22 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_23);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
4288 __Pyx_GOTREF(__pyx_t_22);
4289 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
4290 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 115, __pyx_L1_error)
4291 __Pyx_GOTREF(__pyx_t_23);
4292 __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 115, __pyx_L1_error)
4293 __Pyx_GOTREF(__pyx_t_26);
4294 __pyx_t_24 = PyTuple_New(2);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 115, __pyx_L1_error)
4295 __Pyx_GOTREF(__pyx_t_24);
4296 __Pyx_GIVEREF(__pyx_t_23);
4297 PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_23);
4298 __Pyx_GIVEREF(__pyx_t_26);
4299 PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_26);
4302 __pyx_t_26 = __Pyx_PyObject_GetItem(__pyx_t_22, __pyx_t_24);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 115, __pyx_L1_error)
4303 __Pyx_GOTREF(__pyx_t_26);
4304 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4305 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
4306 __pyx_t_24 = PyNumber_Add(__pyx_t_25, __pyx_t_26);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 115, __pyx_L1_error)
4307 __Pyx_GOTREF(__pyx_t_24);
4308 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
4309 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
4310 __pyx_t_26 = __Pyx_PyFloat_AddObjC(__pyx_t_24, __pyx_float_1_0eneg_20, 1.0e-20, 0, 0);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 115, __pyx_L1_error)
4311 __Pyx_GOTREF(__pyx_t_26);
4312 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
4313 __pyx_t_27 = __pyx_PyFloat_AsDouble(__pyx_t_26);
if (unlikely((__pyx_t_27 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L1_error)
4314 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
4315 __pyx_v_denom = __pyx_t_27;
4324 if (unlikely(__pyx_v_denom == 0)) {
4325 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
4326 __PYX_ERR(0, 116, __pyx_L1_error)
4328 __pyx_t_28 = __pyx_v_eN;
4329 __pyx_t_29 = __pyx_v_ebN_local;
4330 __pyx_t_30 = __pyx_v_k;
4331 __pyx_t_31 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
4333 if (__pyx_t_28 < 0) {
4334 __pyx_t_28 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
4335 if (unlikely(__pyx_t_28 < 0)) __pyx_t_32 = 0;
4336 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_32 = 0;
4337 if (__pyx_t_29 < 0) {
4338 __pyx_t_29 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
4339 if (unlikely(__pyx_t_29 < 0)) __pyx_t_32 = 1;
4340 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_32 = 1;
4341 if (__pyx_t_30 < 0) {
4342 __pyx_t_30 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
4343 if (unlikely(__pyx_t_30 < 0)) __pyx_t_32 = 2;
4344 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_32 = 2;
4345 if (__pyx_t_31 < 0) {
4346 __pyx_t_31 += __pyx_pybuffernd_ebq_vals.diminfo[3].shape;
4347 if (unlikely(__pyx_t_31 < 0)) __pyx_t_32 = 3;
4348 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_ebq_vals.diminfo[3].shape)) __pyx_t_32 = 3;
4349 if (unlikely(__pyx_t_32 != -1)) {
4350 __Pyx_RaiseBufferIndexError(__pyx_t_32);
4351 __PYX_ERR(0, 116, __pyx_L1_error)
4353 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_ebq_vals.diminfo[2].strides, __pyx_t_31, __pyx_pybuffernd_ebq_vals.diminfo[3].strides) = (__pyx_v_numer / __pyx_v_denom);
4369 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4372 __Pyx_XDECREF(__pyx_t_22);
4373 __Pyx_XDECREF(__pyx_t_23);
4374 __Pyx_XDECREF(__pyx_t_24);
4375 __Pyx_XDECREF(__pyx_t_25);
4376 __Pyx_XDECREF(__pyx_t_26);
4377 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4378 __Pyx_PyThreadState_declare
4379 __Pyx_PyThreadState_assign
4380 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4381 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
4382 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4383 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4384 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4385 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4389 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
4390 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4391 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4393 __Pyx_XGIVEREF(__pyx_r);
4394 __Pyx_RefNannyFinishContext();
4407 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4408 static char __pyx_doc_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f = 0.5(f^L_j+f^R_k) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
4409 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage = {
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage};
4410 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4411 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
4412 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
4413 PyArrayObject *__pyx_v_ebq_global_vals = 0;
4414 PyObject *__pyx_v_material_functions = 0;
4415 PyObject *__pyx_r = 0;
4416 __Pyx_RefNannyDeclarations
4417 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage (wrapper)", 0);
4419 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
4420 PyObject* values[4] = {0,0,0,0};
4421 if (unlikely(__pyx_kwds)) {
4423 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4425 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4427 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4429 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4431 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4434 default:
goto __pyx_L5_argtuple_error;
4436 kw_args = PyDict_Size(__pyx_kwds);
4439 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
4440 else goto __pyx_L5_argtuple_error;
4443 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
4445 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 1); __PYX_ERR(0, 118, __pyx_L3_error)
4449 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
4451 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 2); __PYX_ERR(0, 118, __pyx_L3_error)
4455 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
4457 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 3); __PYX_ERR(0, 118, __pyx_L3_error)
4460 if (unlikely(kw_args > 0)) {
4461 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 118, __pyx_L3_error)
4463 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4464 goto __pyx_L5_argtuple_error;
4466 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4467 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4468 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4469 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4471 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[0]);
4472 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[1]);
4473 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[2]);
4474 __pyx_v_material_functions = ((PyObject*)values[3]);
4476 goto __pyx_L4_argument_unpacking_done;
4477 __pyx_L5_argtuple_error:;
4478 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 118, __pyx_L3_error)
4480 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4481 __Pyx_RefNannyFinishContext();
4483 __pyx_L4_argument_unpacking_done:;
4484 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 118, __pyx_L1_error)
4485 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 119, __pyx_L1_error)
4486 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 120, __pyx_L1_error)
4487 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 121, __pyx_L1_error)
4488 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
4495 __Pyx_RefNannyFinishContext();
4499 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
4501 int __pyx_v_material_left;
4502 int __pyx_v_material_right;
4504 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
4505 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
4506 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
4507 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
4508 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
4509 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
4510 PyObject *__pyx_r = NULL;
4511 __Pyx_RefNannyDeclarations
4515 Py_ssize_t __pyx_t_4;
4516 Py_ssize_t __pyx_t_5;
4518 Py_ssize_t __pyx_t_7;
4519 Py_ssize_t __pyx_t_8;
4521 npy_intp __pyx_t_10;
4522 npy_intp __pyx_t_11;
4523 PyObject *__pyx_t_12 = NULL;
4524 PyObject *__pyx_t_13 = NULL;
4525 PyObject *__pyx_t_14 = NULL;
4526 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_15;
4527 Py_ssize_t __pyx_t_16;
4528 Py_ssize_t __pyx_t_17;
4529 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 0);
4530 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
4531 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
4532 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
4533 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
4534 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
4535 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
4536 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
4537 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
4538 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
4539 __pyx_pybuffer_ebq_global_vals.refcount = 0;
4540 __pyx_pybuffernd_ebq_global_vals.data = NULL;
4541 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
4543 __Pyx_BufFmt_StackElem __pyx_stack[1];
4544 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 118, __pyx_L1_error)
4546 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
4548 __Pyx_BufFmt_StackElem __pyx_stack[1];
4549 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 118, __pyx_L1_error)
4551 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
4553 __Pyx_BufFmt_StackElem __pyx_stack[1];
4554 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 118, __pyx_L1_error)
4556 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1];
4565 __pyx_t_1 = (__pyx_v_ebq_global_vals->dimensions[0]);
4566 __pyx_t_2 = __pyx_t_1;
4567 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4568 __pyx_v_ebN = __pyx_t_3;
4577 __pyx_t_4 = __pyx_v_ebN;
4580 if (__pyx_t_4 < 0) {
4581 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4582 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
4583 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
4584 if (__pyx_t_5 < 0) {
4585 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4586 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
4587 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
4588 if (unlikely(__pyx_t_6 != -1)) {
4589 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4590 __PYX_ERR(0, 132, __pyx_L1_error)
4592 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4601 __pyx_t_7 = __pyx_v_ebN;
4604 if (__pyx_t_7 < 0) {
4605 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4606 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 0;
4607 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
4608 if (__pyx_t_8 < 0) {
4609 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4610 if (unlikely(__pyx_t_8 < 0)) __pyx_t_6 = 1;
4611 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
4612 if (unlikely(__pyx_t_6 != -1)) {
4613 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4614 __PYX_ERR(0, 133, __pyx_L1_error)
4616 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4625 __pyx_t_9 = (__pyx_v_ebq_global_vals->dimensions[1]);
4626 __pyx_t_10 = __pyx_t_9;
4627 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
4628 __pyx_v_k = __pyx_t_11;
4637 if (unlikely(__pyx_v_material_functions == Py_None)) {
4638 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4639 __PYX_ERR(0, 135, __pyx_L1_error)
4641 __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 135, __pyx_L1_error)
4642 __Pyx_GOTREF(__pyx_t_12);
4643 __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 135, __pyx_L1_error)
4644 __Pyx_GOTREF(__pyx_t_13);
4645 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4654 if (unlikely(__pyx_v_material_functions == Py_None)) {
4655 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4656 __PYX_ERR(0, 136, __pyx_L1_error)
4658 __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 136, __pyx_L1_error)
4659 __Pyx_GOTREF(__pyx_t_12);
4660 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 136, __pyx_L1_error)
4661 __Pyx_GOTREF(__pyx_t_14);
4662 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4671 __pyx_t_12 = PyNumber_Add(__pyx_t_13, __pyx_t_14);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 135, __pyx_L1_error)
4672 __Pyx_GOTREF(__pyx_t_12);
4673 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4674 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4675 __pyx_t_14 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 135, __pyx_L1_error)
4676 __Pyx_GOTREF(__pyx_t_14);
4677 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4678 __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_14);
if (unlikely((__pyx_t_15 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error)
4679 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4680 __pyx_t_16 = __pyx_v_ebN;
4681 __pyx_t_17 = __pyx_v_k;
4683 if (__pyx_t_16 < 0) {
4684 __pyx_t_16 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
4685 if (unlikely(__pyx_t_16 < 0)) __pyx_t_6 = 0;
4686 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_6 = 0;
4687 if (__pyx_t_17 < 0) {
4688 __pyx_t_17 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
4689 if (unlikely(__pyx_t_17 < 0)) __pyx_t_6 = 1;
4690 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_6 = 1;
4691 if (unlikely(__pyx_t_6 != -1)) {
4692 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4693 __PYX_ERR(0, 135, __pyx_L1_error)
4695 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides) = __pyx_t_15;
4708 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4711 __Pyx_XDECREF(__pyx_t_12);
4712 __Pyx_XDECREF(__pyx_t_13);
4713 __Pyx_XDECREF(__pyx_t_14);
4714 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4715 __Pyx_PyThreadState_declare
4716 __Pyx_PyThreadState_assign
4717 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4718 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
4719 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4720 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4721 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4722 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4726 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
4727 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4728 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4730 __Pyx_XGIVEREF(__pyx_r);
4731 __Pyx_RefNannyFinishContext();
4744 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4745 static char __pyx_doc_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn} = f^L_{j,mn}f^R_{k,mn}/(f^L_{j,mn}+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
4746 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage = {
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage};
4747 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4749 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
4750 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
4751 PyArrayObject *__pyx_v_ebq_global_vals = 0;
4752 PyObject *__pyx_v_material_functions = 0;
4753 PyObject *__pyx_r = 0;
4754 __Pyx_RefNannyDeclarations
4755 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage (wrapper)", 0);
4757 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
4758 PyObject* values[5] = {0,0,0,0,0};
4759 if (unlikely(__pyx_kwds)) {
4761 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4763 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4765 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4767 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4769 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4771 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4774 default:
goto __pyx_L5_argtuple_error;
4776 kw_args = PyDict_Size(__pyx_kwds);
4779 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
4780 else goto __pyx_L5_argtuple_error;
4783 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
4785 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 1); __PYX_ERR(0, 139, __pyx_L3_error)
4789 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
4791 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 2); __PYX_ERR(0, 139, __pyx_L3_error)
4795 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
4797 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 3); __PYX_ERR(0, 139, __pyx_L3_error)
4801 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
4803 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 4); __PYX_ERR(0, 139, __pyx_L3_error)
4806 if (unlikely(kw_args > 0)) {
4807 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 139, __pyx_L3_error)
4809 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4810 goto __pyx_L5_argtuple_error;
4812 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4813 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4814 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4815 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4816 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4818 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L3_error)
4819 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
4820 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
4821 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[3]);
4822 __pyx_v_material_functions = ((PyObject*)values[4]);
4824 goto __pyx_L4_argument_unpacking_done;
4825 __pyx_L5_argtuple_error:;
4826 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 139, __pyx_L3_error)
4828 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4829 __Pyx_RefNannyFinishContext();
4831 __pyx_L4_argument_unpacking_done:;
4832 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 140, __pyx_L1_error)
4833 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 141, __pyx_L1_error)
4834 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 142, __pyx_L1_error)
4835 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 143, __pyx_L1_error)
4836 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
4843 __Pyx_RefNannyFinishContext();
4847 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
4850 int __pyx_v_material_left;
4851 int __pyx_v_material_right;
4854 double __pyx_v_numer;
4855 double __pyx_v_denom;
4856 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
4857 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
4858 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
4859 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
4860 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
4861 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
4862 PyObject *__pyx_r = NULL;
4863 __Pyx_RefNannyDeclarations
4867 Py_ssize_t __pyx_t_4;
4868 Py_ssize_t __pyx_t_5;
4870 Py_ssize_t __pyx_t_7;
4871 Py_ssize_t __pyx_t_8;
4873 npy_intp __pyx_t_10;
4880 PyObject *__pyx_t_17 = NULL;
4881 PyObject *__pyx_t_18 = NULL;
4882 PyObject *__pyx_t_19 = NULL;
4883 PyObject *__pyx_t_20 = NULL;
4884 PyObject *__pyx_t_21 = NULL;
4886 Py_ssize_t __pyx_t_23;
4887 Py_ssize_t __pyx_t_24;
4888 Py_ssize_t __pyx_t_25;
4890 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 0);
4891 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
4892 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
4893 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
4894 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
4895 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
4896 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
4897 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
4898 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
4899 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
4900 __pyx_pybuffer_ebq_global_vals.refcount = 0;
4901 __pyx_pybuffernd_ebq_global_vals.data = NULL;
4902 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
4904 __Pyx_BufFmt_StackElem __pyx_stack[1];
4905 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
4907 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
4909 __Pyx_BufFmt_StackElem __pyx_stack[1];
4910 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
4912 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
4914 __Pyx_BufFmt_StackElem __pyx_stack[1];
4915 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
4917 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[2];
4926 __pyx_t_1 = (__pyx_v_ebq_global_vals->dimensions[0]);
4927 __pyx_t_2 = __pyx_t_1;
4928 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4929 __pyx_v_ebN = __pyx_t_3;
4938 __pyx_t_4 = __pyx_v_ebN;
4941 if (__pyx_t_4 < 0) {
4942 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4943 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
4944 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
4945 if (__pyx_t_5 < 0) {
4946 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4947 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
4948 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
4949 if (unlikely(__pyx_t_6 != -1)) {
4950 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4951 __PYX_ERR(0, 155, __pyx_L1_error)
4953 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4962 __pyx_t_7 = __pyx_v_ebN;
4965 if (__pyx_t_7 < 0) {
4966 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4967 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 0;
4968 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
4969 if (__pyx_t_8 < 0) {
4970 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4971 if (unlikely(__pyx_t_8 < 0)) __pyx_t_6 = 1;
4972 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
4973 if (unlikely(__pyx_t_6 != -1)) {
4974 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4975 __PYX_ERR(0, 156, __pyx_L1_error)
4977 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4986 __pyx_t_9 = (__pyx_v_ebq_global_vals->dimensions[1]);
4987 __pyx_t_10 = __pyx_t_9;
4988 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_10; __pyx_t_6+=1) {
4989 __pyx_v_k = __pyx_t_6;
4998 __pyx_t_11 = __pyx_v_nd;
4999 __pyx_t_12 = __pyx_t_11;
5000 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
5001 __pyx_v_I = __pyx_t_13;
5010 __pyx_t_14 = __pyx_v_nd;
5011 __pyx_t_15 = __pyx_t_14;
5012 for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
5013 __pyx_v_J = __pyx_t_16;
5022 if (unlikely(__pyx_v_material_functions == Py_None)) {
5023 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5024 __PYX_ERR(0, 160, __pyx_L1_error)
5026 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
5027 __Pyx_GOTREF(__pyx_t_17);
5028 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 160, __pyx_L1_error)
5029 __Pyx_GOTREF(__pyx_t_18);
5030 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5031 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
5032 __Pyx_GOTREF(__pyx_t_17);
5033 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 160, __pyx_L1_error)
5034 __Pyx_GOTREF(__pyx_t_19);
5035 __pyx_t_20 = PyTuple_New(2);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 160, __pyx_L1_error)
5036 __Pyx_GOTREF(__pyx_t_20);
5037 __Pyx_GIVEREF(__pyx_t_17);
5038 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_17);
5039 __Pyx_GIVEREF(__pyx_t_19);
5040 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_19);
5043 __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_20);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 160, __pyx_L1_error)
5044 __Pyx_GOTREF(__pyx_t_19);
5045 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5046 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
5047 __pyx_t_20 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_19);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 160, __pyx_L1_error)
5048 __Pyx_GOTREF(__pyx_t_20);
5049 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5050 if (unlikely(__pyx_v_material_functions == Py_None)) {
5051 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5052 __PYX_ERR(0, 160, __pyx_L1_error)
5054 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 160, __pyx_L1_error)
5055 __Pyx_GOTREF(__pyx_t_19);
5056 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_19);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 160, __pyx_L1_error)
5057 __Pyx_GOTREF(__pyx_t_18);
5058 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5059 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 160, __pyx_L1_error)
5060 __Pyx_GOTREF(__pyx_t_19);
5061 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
5062 __Pyx_GOTREF(__pyx_t_17);
5063 __pyx_t_21 = PyTuple_New(2);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 160, __pyx_L1_error)
5064 __Pyx_GOTREF(__pyx_t_21);
5065 __Pyx_GIVEREF(__pyx_t_19);
5066 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_19);
5067 __Pyx_GIVEREF(__pyx_t_17);
5068 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_17);
5071 __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_21);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
5072 __Pyx_GOTREF(__pyx_t_17);
5073 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5074 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
5075 __pyx_t_21 = PyNumber_Multiply(__pyx_t_20, __pyx_t_17);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 160, __pyx_L1_error)
5076 __Pyx_GOTREF(__pyx_t_21);
5077 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
5078 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5079 __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_21);
if (unlikely((__pyx_t_22 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
5080 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
5081 __pyx_v_numer = __pyx_t_22;
5090 if (unlikely(__pyx_v_material_functions == Py_None)) {
5091 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5092 __PYX_ERR(0, 161, __pyx_L1_error)
5094 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 161, __pyx_L1_error)
5095 __Pyx_GOTREF(__pyx_t_21);
5096 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_21);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 161, __pyx_L1_error)
5097 __Pyx_GOTREF(__pyx_t_17);
5098 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
5099 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 161, __pyx_L1_error)
5100 __Pyx_GOTREF(__pyx_t_21);
5101 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 161, __pyx_L1_error)
5102 __Pyx_GOTREF(__pyx_t_20);
5103 __pyx_t_18 = PyTuple_New(2);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 161, __pyx_L1_error)
5104 __Pyx_GOTREF(__pyx_t_18);
5105 __Pyx_GIVEREF(__pyx_t_21);
5106 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_21);
5107 __Pyx_GIVEREF(__pyx_t_20);
5108 PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_20);
5111 __pyx_t_20 = __Pyx_PyObject_GetItem(__pyx_t_17, __pyx_t_18);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 161, __pyx_L1_error)
5112 __Pyx_GOTREF(__pyx_t_20);
5113 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5114 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5115 if (unlikely(__pyx_v_material_functions == Py_None)) {
5116 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5117 __PYX_ERR(0, 161, __pyx_L1_error)
5119 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 161, __pyx_L1_error)
5120 __Pyx_GOTREF(__pyx_t_18);
5121 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 161, __pyx_L1_error)
5122 __Pyx_GOTREF(__pyx_t_17);
5123 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5124 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 161, __pyx_L1_error)
5125 __Pyx_GOTREF(__pyx_t_18);
5126 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 161, __pyx_L1_error)
5127 __Pyx_GOTREF(__pyx_t_21);
5128 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
5129 __Pyx_GOTREF(__pyx_t_19);
5130 __Pyx_GIVEREF(__pyx_t_18);
5131 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18);
5132 __Pyx_GIVEREF(__pyx_t_21);
5133 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_21);
5136 __pyx_t_21 = __Pyx_PyObject_GetItem(__pyx_t_17, __pyx_t_19);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 161, __pyx_L1_error)
5137 __Pyx_GOTREF(__pyx_t_21);
5138 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5139 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5140 __pyx_t_19 = PyNumber_Add(__pyx_t_20, __pyx_t_21);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
5141 __Pyx_GOTREF(__pyx_t_19);
5142 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
5143 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
5144 __pyx_t_21 = __Pyx_PyFloat_AddObjC(__pyx_t_19, __pyx_float_1_0eneg_20, 1.0e-20, 0, 0);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 161, __pyx_L1_error)
5145 __Pyx_GOTREF(__pyx_t_21);
5146 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5147 __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_21);
if (unlikely((__pyx_t_22 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
5148 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
5149 __pyx_v_denom = __pyx_t_22;
5158 if (unlikely(__pyx_v_denom == 0)) {
5159 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
5160 __PYX_ERR(0, 162, __pyx_L1_error)
5162 __pyx_t_23 = __pyx_v_ebN;
5163 __pyx_t_24 = __pyx_v_k;
5164 __pyx_t_25 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
5166 if (__pyx_t_23 < 0) {
5167 __pyx_t_23 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
5168 if (unlikely(__pyx_t_23 < 0)) __pyx_t_26 = 0;
5169 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_26 = 0;
5170 if (__pyx_t_24 < 0) {
5171 __pyx_t_24 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
5172 if (unlikely(__pyx_t_24 < 0)) __pyx_t_26 = 1;
5173 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_26 = 1;
5174 if (__pyx_t_25 < 0) {
5175 __pyx_t_25 += __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape;
5176 if (unlikely(__pyx_t_25 < 0)) __pyx_t_26 = 2;
5177 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape)) __pyx_t_26 = 2;
5178 if (unlikely(__pyx_t_26 != -1)) {
5179 __Pyx_RaiseBufferIndexError(__pyx_t_26);
5180 __PYX_ERR(0, 162, __pyx_L1_error)
5182 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides) = (__pyx_v_numer / __pyx_v_denom);
5197 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5200 __Pyx_XDECREF(__pyx_t_17);
5201 __Pyx_XDECREF(__pyx_t_18);
5202 __Pyx_XDECREF(__pyx_t_19);
5203 __Pyx_XDECREF(__pyx_t_20);
5204 __Pyx_XDECREF(__pyx_t_21);
5205 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5206 __Pyx_PyThreadState_declare
5207 __Pyx_PyThreadState_assign
5208 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5209 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
5210 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
5211 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
5212 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5213 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
5217 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
5218 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
5219 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
5221 __Pyx_XGIVEREF(__pyx_r);
5222 __Pyx_RefNannyFinishContext();
5235 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5236 static char __pyx_doc_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements[] =
"\n loop over quadrature array and evaluate function f_j(x,t) assuming element is material j\n likely little improvement right now without correct typing of material_functions\n ";
5237 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements = {
"evaluateScalarMaterialFunctionOverElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements};
5238 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5240 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
5241 PyArrayObject *__pyx_v_x = 0;
5242 PyArrayObject *__pyx_v_q_vals = 0;
5243 PyObject *__pyx_v_material_functions = 0;
5244 PyObject *__pyx_r = 0;
5245 __Pyx_RefNannyDeclarations
5246 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElements (wrapper)", 0);
5248 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_x,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
5249 PyObject* values[5] = {0,0,0,0,0};
5250 if (unlikely(__pyx_kwds)) {
5252 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5254 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5256 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5258 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5260 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5262 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5265 default:
goto __pyx_L5_argtuple_error;
5267 kw_args = PyDict_Size(__pyx_kwds);
5270 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5271 else goto __pyx_L5_argtuple_error;
5274 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
5276 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 1); __PYX_ERR(0, 165, __pyx_L3_error)
5280 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5282 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 2); __PYX_ERR(0, 165, __pyx_L3_error)
5286 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
5288 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 3); __PYX_ERR(0, 165, __pyx_L3_error)
5292 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
5294 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 4); __PYX_ERR(0, 165, __pyx_L3_error)
5297 if (unlikely(kw_args > 0)) {
5298 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 165, __pyx_L3_error)
5300 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5301 goto __pyx_L5_argtuple_error;
5303 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5304 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5305 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5306 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5307 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5309 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L3_error)
5310 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[1]);
5311 __pyx_v_x = ((PyArrayObject *)values[2]);
5312 __pyx_v_q_vals = ((PyArrayObject *)values[3]);
5313 __pyx_v_material_functions = ((PyObject*)values[4]);
5315 goto __pyx_L4_argument_unpacking_done;
5316 __pyx_L5_argtuple_error:;
5317 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error)
5319 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5320 __Pyx_RefNannyFinishContext();
5322 __pyx_L4_argument_unpacking_done:;
5323 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 166, __pyx_L1_error)
5324 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 167, __pyx_L1_error)
5325 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 168, __pyx_L1_error)
5326 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 169, __pyx_L1_error)
5327 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(__pyx_self, __pyx_v_t, __pyx_v_elementMaterialTypes, __pyx_v_x, __pyx_v_q_vals, __pyx_v_material_functions);
5334 __Pyx_RefNannyFinishContext();
5338 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
5341 int __pyx_v_material;
5342 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
5343 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
5344 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
5345 __Pyx_Buffer __pyx_pybuffer_q_vals;
5346 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
5347 __Pyx_Buffer __pyx_pybuffer_x;
5348 PyObject *__pyx_r = NULL;
5349 __Pyx_RefNannyDeclarations
5353 Py_ssize_t __pyx_t_4;
5357 PyObject *__pyx_t_8 = NULL;
5358 PyObject *__pyx_t_9 = NULL;
5359 PyObject *__pyx_t_10 = NULL;
5360 PyObject *__pyx_t_11 = NULL;
5361 PyObject *__pyx_t_12 = NULL;
5363 PyObject *__pyx_t_14 = NULL;
5364 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_15;
5365 Py_ssize_t __pyx_t_16;
5366 Py_ssize_t __pyx_t_17;
5367 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElements", 0);
5368 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
5369 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
5370 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
5371 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
5372 __pyx_pybuffer_x.pybuffer.buf = NULL;
5373 __pyx_pybuffer_x.refcount = 0;
5374 __pyx_pybuffernd_x.data = NULL;
5375 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
5376 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
5377 __pyx_pybuffer_q_vals.refcount = 0;
5378 __pyx_pybuffernd_q_vals.data = NULL;
5379 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
5381 __Pyx_BufFmt_StackElem __pyx_stack[1];
5382 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error)
5384 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
5386 __Pyx_BufFmt_StackElem __pyx_stack[1];
5387 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error)
5389 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
5391 __Pyx_BufFmt_StackElem __pyx_stack[1];
5392 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error)
5394 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1];
5403 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
5404 __pyx_t_2 = __pyx_t_1;
5405 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
5406 __pyx_v_eN = __pyx_t_3;
5415 __pyx_t_4 = __pyx_v_eN;
5417 if (__pyx_t_4 < 0) {
5418 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
5419 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
5420 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
5421 if (unlikely(__pyx_t_5 != -1)) {
5422 __Pyx_RaiseBufferIndexError(__pyx_t_5);
5423 __PYX_ERR(0, 176, __pyx_L1_error)
5425 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
5434 __pyx_t_6 = (__pyx_v_x->dimensions[1]);
5435 __pyx_t_7 = __pyx_t_6;
5436 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
5437 __pyx_v_k = __pyx_t_5;
5446 if (unlikely(__pyx_v_material_functions == Py_None)) {
5447 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5448 __PYX_ERR(0, 178, __pyx_L1_error)
5450 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 178, __pyx_L1_error)
5451 __Pyx_GOTREF(__pyx_t_9);
5452 __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_9);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 178, __pyx_L1_error)
5453 __Pyx_GOTREF(__pyx_t_10);
5454 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5455 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 178, __pyx_L1_error)
5456 __Pyx_GOTREF(__pyx_t_9);
5457 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 178, __pyx_L1_error)
5458 __Pyx_GOTREF(__pyx_t_11);
5459 __pyx_t_12 = PyTuple_New(2);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 178, __pyx_L1_error)
5460 __Pyx_GOTREF(__pyx_t_12);
5461 __Pyx_GIVEREF(__pyx_t_9);
5462 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9);
5463 __Pyx_GIVEREF(__pyx_t_11);
5464 PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
5467 __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_12);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 178, __pyx_L1_error)
5468 __Pyx_GOTREF(__pyx_t_11);
5469 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5470 __pyx_t_12 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 178, __pyx_L1_error)
5471 __Pyx_GOTREF(__pyx_t_12);
5474 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
5475 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
5476 if (likely(__pyx_t_9)) {
5477 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
5478 __Pyx_INCREF(__pyx_t_9);
5479 __Pyx_INCREF(
function);
5480 __Pyx_DECREF_SET(__pyx_t_10,
function);
5484 #if CYTHON_FAST_PYCALL 5485 if (PyFunction_Check(__pyx_t_10)) {
5486 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5487 __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
5488 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5489 __Pyx_GOTREF(__pyx_t_8);
5490 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5491 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5494 #if CYTHON_FAST_PYCCALL 5495 if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
5496 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5497 __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
5498 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5499 __Pyx_GOTREF(__pyx_t_8);
5500 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5501 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5505 __pyx_t_14 = PyTuple_New(2+__pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 178, __pyx_L1_error)
5506 __Pyx_GOTREF(__pyx_t_14);
5508 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_9); __pyx_t_9 = NULL;
5510 __Pyx_GIVEREF(__pyx_t_11);
5511 PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_11);
5512 __Pyx_GIVEREF(__pyx_t_12);
5513 PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_12);
5516 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_14, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
5517 __Pyx_GOTREF(__pyx_t_8);
5518 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5520 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5521 __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_8);
if (unlikely((__pyx_t_15 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L1_error)
5522 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5523 __pyx_t_16 = __pyx_v_eN;
5524 __pyx_t_17 = __pyx_v_k;
5526 if (__pyx_t_16 < 0) {
5527 __pyx_t_16 += __pyx_pybuffernd_q_vals.diminfo[0].shape;
5528 if (unlikely(__pyx_t_16 < 0)) __pyx_t_13 = 0;
5529 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_q_vals.diminfo[0].shape)) __pyx_t_13 = 0;
5530 if (__pyx_t_17 < 0) {
5531 __pyx_t_17 += __pyx_pybuffernd_q_vals.diminfo[1].shape;
5532 if (unlikely(__pyx_t_17 < 0)) __pyx_t_13 = 1;
5533 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_q_vals.diminfo[1].shape)) __pyx_t_13 = 1;
5534 if (unlikely(__pyx_t_13 != -1)) {
5535 __Pyx_RaiseBufferIndexError(__pyx_t_13);
5536 __PYX_ERR(0, 178, __pyx_L1_error)
5538 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_q_vals.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_q_vals.diminfo[1].strides) = __pyx_t_15;
5551 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5554 __Pyx_XDECREF(__pyx_t_8);
5555 __Pyx_XDECREF(__pyx_t_9);
5556 __Pyx_XDECREF(__pyx_t_10);
5557 __Pyx_XDECREF(__pyx_t_11);
5558 __Pyx_XDECREF(__pyx_t_12);
5559 __Pyx_XDECREF(__pyx_t_14);
5560 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5561 __Pyx_PyThreadState_declare
5562 __Pyx_PyThreadState_assign
5563 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5564 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5565 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5566 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5567 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5568 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5572 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5573 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5574 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5576 __Pyx_XGIVEREF(__pyx_r);
5577 __Pyx_RefNannyFinishContext();
5590 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5591 static char __pyx_doc_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements[] =
"\n loop over quadrature array and evaluate function \013ec f_j(x,t) assuming element is material j\n ";
5592 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements = {
"evaluateVectorMaterialFunctionOverElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements};
5593 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5595 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
5596 PyArrayObject *__pyx_v_x = 0;
5597 PyArrayObject *__pyx_v_q_vals = 0;
5598 PyObject *__pyx_v_material_functions = 0;
5599 PyObject *__pyx_r = 0;
5600 __Pyx_RefNannyDeclarations
5601 __Pyx_RefNannySetupContext(
"evaluateVectorMaterialFunctionOverElements (wrapper)", 0);
5603 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_x,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
5604 PyObject* values[5] = {0,0,0,0,0};
5605 if (unlikely(__pyx_kwds)) {
5607 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5609 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5611 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5613 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5615 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5617 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5620 default:
goto __pyx_L5_argtuple_error;
5622 kw_args = PyDict_Size(__pyx_kwds);
5625 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5626 else goto __pyx_L5_argtuple_error;
5629 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
5631 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 1); __PYX_ERR(0, 180, __pyx_L3_error)
5635 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5637 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 2); __PYX_ERR(0, 180, __pyx_L3_error)
5641 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
5643 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 3); __PYX_ERR(0, 180, __pyx_L3_error)
5647 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
5649 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 4); __PYX_ERR(0, 180, __pyx_L3_error)
5652 if (unlikely(kw_args > 0)) {
5653 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateVectorMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 180, __pyx_L3_error)
5655 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5656 goto __pyx_L5_argtuple_error;
5658 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5659 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5660 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5661 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5662 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5664 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L3_error)
5665 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[1]);
5666 __pyx_v_x = ((PyArrayObject *)values[2]);
5667 __pyx_v_q_vals = ((PyArrayObject *)values[3]);
5668 __pyx_v_material_functions = ((PyObject*)values[4]);
5670 goto __pyx_L4_argument_unpacking_done;
5671 __pyx_L5_argtuple_error:;
5672 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 180, __pyx_L3_error)
5674 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5675 __Pyx_RefNannyFinishContext();
5677 __pyx_L4_argument_unpacking_done:;
5678 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 181, __pyx_L1_error)
5679 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 182, __pyx_L1_error)
5680 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 183, __pyx_L1_error)
5681 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 184, __pyx_L1_error)
5682 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(__pyx_self, __pyx_v_t, __pyx_v_elementMaterialTypes, __pyx_v_x, __pyx_v_q_vals, __pyx_v_material_functions);
5689 __Pyx_RefNannyFinishContext();
5693 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
5696 int __pyx_v_material;
5697 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
5698 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
5699 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
5700 __Pyx_Buffer __pyx_pybuffer_q_vals;
5701 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
5702 __Pyx_Buffer __pyx_pybuffer_x;
5703 PyObject *__pyx_r = NULL;
5704 __Pyx_RefNannyDeclarations
5708 Py_ssize_t __pyx_t_4;
5712 PyObject *__pyx_t_8 = NULL;
5713 PyObject *__pyx_t_9 = NULL;
5714 PyObject *__pyx_t_10 = NULL;
5715 PyObject *__pyx_t_11 = NULL;
5716 PyObject *__pyx_t_12 = NULL;
5718 PyObject *__pyx_t_14 = NULL;
5719 __Pyx_RefNannySetupContext(
"evaluateVectorMaterialFunctionOverElements", 0);
5720 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
5721 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
5722 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
5723 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
5724 __pyx_pybuffer_x.pybuffer.buf = NULL;
5725 __pyx_pybuffer_x.refcount = 0;
5726 __pyx_pybuffernd_x.data = NULL;
5727 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
5728 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
5729 __pyx_pybuffer_q_vals.refcount = 0;
5730 __pyx_pybuffernd_q_vals.data = NULL;
5731 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
5733 __Pyx_BufFmt_StackElem __pyx_stack[1];
5734 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 180, __pyx_L1_error)
5736 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
5738 __Pyx_BufFmt_StackElem __pyx_stack[1];
5739 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 180, __pyx_L1_error)
5741 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
5743 __Pyx_BufFmt_StackElem __pyx_stack[1];
5744 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 180, __pyx_L1_error)
5746 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_vals.diminfo[2].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_vals.diminfo[2].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[2];
5755 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
5756 __pyx_t_2 = __pyx_t_1;
5757 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
5758 __pyx_v_eN = __pyx_t_3;
5767 __pyx_t_4 = __pyx_v_eN;
5769 if (__pyx_t_4 < 0) {
5770 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
5771 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
5772 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
5773 if (unlikely(__pyx_t_5 != -1)) {
5774 __Pyx_RaiseBufferIndexError(__pyx_t_5);
5775 __PYX_ERR(0, 190, __pyx_L1_error)
5777 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
5786 __pyx_t_6 = (__pyx_v_x->dimensions[1]);
5787 __pyx_t_7 = __pyx_t_6;
5788 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
5789 __pyx_v_k = __pyx_t_5;
5798 if (unlikely(__pyx_v_material_functions == Py_None)) {
5799 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5800 __PYX_ERR(0, 192, __pyx_L1_error)
5802 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 192, __pyx_L1_error)
5803 __Pyx_GOTREF(__pyx_t_9);
5804 __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_9);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error)
5805 __Pyx_GOTREF(__pyx_t_10);
5806 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5807 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 192, __pyx_L1_error)
5808 __Pyx_GOTREF(__pyx_t_9);
5809 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 192, __pyx_L1_error)
5810 __Pyx_GOTREF(__pyx_t_11);
5811 __pyx_t_12 = PyTuple_New(2);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 192, __pyx_L1_error)
5812 __Pyx_GOTREF(__pyx_t_12);
5813 __Pyx_GIVEREF(__pyx_t_9);
5814 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9);
5815 __Pyx_GIVEREF(__pyx_t_11);
5816 PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
5819 __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_12);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 192, __pyx_L1_error)
5820 __Pyx_GOTREF(__pyx_t_11);
5821 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5822 __pyx_t_12 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 192, __pyx_L1_error)
5823 __Pyx_GOTREF(__pyx_t_12);
5826 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
5827 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
5828 if (likely(__pyx_t_9)) {
5829 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
5830 __Pyx_INCREF(__pyx_t_9);
5831 __Pyx_INCREF(
function);
5832 __Pyx_DECREF_SET(__pyx_t_10,
function);
5836 #if CYTHON_FAST_PYCALL 5837 if (PyFunction_Check(__pyx_t_10)) {
5838 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5839 __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5840 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5841 __Pyx_GOTREF(__pyx_t_8);
5842 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5843 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5846 #if CYTHON_FAST_PYCCALL 5847 if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
5848 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5849 __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5850 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5851 __Pyx_GOTREF(__pyx_t_8);
5852 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5853 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5857 __pyx_t_14 = PyTuple_New(2+__pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 192, __pyx_L1_error)
5858 __Pyx_GOTREF(__pyx_t_14);
5860 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_9); __pyx_t_9 = NULL;
5862 __Pyx_GIVEREF(__pyx_t_11);
5863 PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_11);
5864 __Pyx_GIVEREF(__pyx_t_12);
5865 PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_12);
5868 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_14, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5869 __Pyx_GOTREF(__pyx_t_8);
5870 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5872 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5873 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flat);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error)
5874 __Pyx_GOTREF(__pyx_t_10);
5875 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5876 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5877 __Pyx_GOTREF(__pyx_t_8);
5878 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 192, __pyx_L1_error)
5879 __Pyx_GOTREF(__pyx_t_14);
5880 __pyx_t_12 = PyTuple_New(3);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 192, __pyx_L1_error)
5881 __Pyx_GOTREF(__pyx_t_12);
5882 __Pyx_GIVEREF(__pyx_t_8);
5883 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8);
5884 __Pyx_GIVEREF(__pyx_t_14);
5885 PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_14);
5886 __Pyx_INCREF(__pyx_slice_);
5887 __Pyx_GIVEREF(__pyx_slice_);
5888 PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_slice_);
5891 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_q_vals), __pyx_t_12, __pyx_t_10) < 0)) __PYX_ERR(0, 192, __pyx_L1_error)
5892 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5893 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5906 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5909 __Pyx_XDECREF(__pyx_t_8);
5910 __Pyx_XDECREF(__pyx_t_9);
5911 __Pyx_XDECREF(__pyx_t_10);
5912 __Pyx_XDECREF(__pyx_t_11);
5913 __Pyx_XDECREF(__pyx_t_12);
5914 __Pyx_XDECREF(__pyx_t_14);
5915 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5916 __Pyx_PyThreadState_declare
5917 __Pyx_PyThreadState_assign
5918 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5919 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5920 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5921 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5922 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5923 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5927 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5928 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5929 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5931 __Pyx_XGIVEREF(__pyx_r);
5932 __Pyx_RefNannyFinishContext();
5945 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5946 static char __pyx_doc_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f(x,t) = 0.5(f^L_j(x,t)+f^R_k(x,t)) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
5947 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage = {
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage};
5948 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5950 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
5951 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
5952 PyArrayObject *__pyx_v_x = 0;
5953 PyArrayObject *__pyx_v_ebq_vals = 0;
5954 PyObject *__pyx_v_material_functions = 0;
5955 PyObject *__pyx_r = 0;
5956 __Pyx_RefNannyDeclarations
5957 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage (wrapper)", 0);
5959 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
5960 PyObject* values[6] = {0,0,0,0,0,0};
5961 if (unlikely(__pyx_kwds)) {
5963 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5965 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5967 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5969 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5971 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5973 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5975 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5978 default:
goto __pyx_L5_argtuple_error;
5980 kw_args = PyDict_Size(__pyx_kwds);
5983 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5984 else goto __pyx_L5_argtuple_error;
5987 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
5989 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 1); __PYX_ERR(0, 195, __pyx_L3_error)
5993 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
5995 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 2); __PYX_ERR(0, 195, __pyx_L3_error)
5999 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
6001 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 3); __PYX_ERR(0, 195, __pyx_L3_error)
6005 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
6007 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 4); __PYX_ERR(0, 195, __pyx_L3_error)
6011 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
6013 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 5); __PYX_ERR(0, 195, __pyx_L3_error)
6016 if (unlikely(kw_args > 0)) {
6017 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 195, __pyx_L3_error)
6019 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6020 goto __pyx_L5_argtuple_error;
6022 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6023 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6024 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6025 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6026 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6027 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6029 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L3_error)
6030 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
6031 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
6032 __pyx_v_x = ((PyArrayObject *)values[3]);
6033 __pyx_v_ebq_vals = ((PyArrayObject *)values[4]);
6034 __pyx_v_material_functions = ((PyObject*)values[5]);
6036 goto __pyx_L4_argument_unpacking_done;
6037 __pyx_L5_argtuple_error:;
6038 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 195, __pyx_L3_error)
6040 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6041 __Pyx_RefNannyFinishContext();
6043 __pyx_L4_argument_unpacking_done:;
6044 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 196, __pyx_L1_error)
6045 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 197, __pyx_L1_error)
6046 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 198, __pyx_L1_error)
6047 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 199, __pyx_L1_error)
6048 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 200, __pyx_L1_error)
6049 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_vals, __pyx_v_material_functions);
6056 __Pyx_RefNannyFinishContext();
6060 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
6063 int __pyx_v_ebN_local;
6065 int __pyx_v_material_left;
6066 int __pyx_v_material_right;
6067 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
6068 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
6069 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
6070 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
6071 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
6072 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
6073 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
6074 __Pyx_Buffer __pyx_pybuffer_x;
6075 PyObject *__pyx_r = NULL;
6076 __Pyx_RefNannyDeclarations
6083 Py_ssize_t __pyx_t_7;
6084 Py_ssize_t __pyx_t_8;
6086 Py_ssize_t __pyx_t_10;
6087 Py_ssize_t __pyx_t_11;
6088 Py_ssize_t __pyx_t_12;
6089 Py_ssize_t __pyx_t_13;
6090 npy_intp __pyx_t_14;
6091 npy_intp __pyx_t_15;
6092 PyObject *__pyx_t_16 = NULL;
6093 PyObject *__pyx_t_17 = NULL;
6094 PyObject *__pyx_t_18 = NULL;
6095 PyObject *__pyx_t_19 = NULL;
6096 PyObject *__pyx_t_20 = NULL;
6097 PyObject *__pyx_t_21 = NULL;
6099 PyObject *__pyx_t_23 = NULL;
6100 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_24;
6101 Py_ssize_t __pyx_t_25;
6102 Py_ssize_t __pyx_t_26;
6103 Py_ssize_t __pyx_t_27;
6104 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 0);
6105 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
6106 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
6107 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
6108 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
6109 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
6110 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
6111 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
6112 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
6113 __pyx_pybuffer_x.pybuffer.buf = NULL;
6114 __pyx_pybuffer_x.refcount = 0;
6115 __pyx_pybuffernd_x.data = NULL;
6116 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
6117 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
6118 __pyx_pybuffer_ebq_vals.refcount = 0;
6119 __pyx_pybuffernd_ebq_vals.data = NULL;
6120 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
6122 __Pyx_BufFmt_StackElem __pyx_stack[1];
6123 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6125 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
6127 __Pyx_BufFmt_StackElem __pyx_stack[1];
6128 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6130 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
6132 __Pyx_BufFmt_StackElem __pyx_stack[1];
6133 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6135 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
6137 __Pyx_BufFmt_StackElem __pyx_stack[1];
6138 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6140 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2];
6149 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
6150 __pyx_t_2 = __pyx_t_1;
6151 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
6152 __pyx_v_eN = __pyx_t_3;
6161 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
6162 __pyx_t_5 = __pyx_t_4;
6163 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
6164 __pyx_v_ebN_local = __pyx_t_6;
6173 __pyx_t_7 = __pyx_v_eN;
6174 __pyx_t_8 = __pyx_v_ebN_local;
6176 if (__pyx_t_7 < 0) {
6177 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
6178 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
6179 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
6180 if (__pyx_t_8 < 0) {
6181 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
6182 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
6183 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
6184 if (unlikely(__pyx_t_9 != -1)) {
6185 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6186 __PYX_ERR(0, 212, __pyx_L1_error)
6188 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
6197 __pyx_t_10 = __pyx_v_ebN;
6200 if (__pyx_t_10 < 0) {
6201 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6202 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
6203 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6204 if (__pyx_t_11 < 0) {
6205 __pyx_t_11 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6206 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
6207 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6208 if (unlikely(__pyx_t_9 != -1)) {
6209 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6210 __PYX_ERR(0, 213, __pyx_L1_error)
6212 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6221 __pyx_t_12 = __pyx_v_ebN;
6224 if (__pyx_t_12 < 0) {
6225 __pyx_t_12 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6226 if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 0;
6227 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6228 if (__pyx_t_13 < 0) {
6229 __pyx_t_13 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6230 if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 1;
6231 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6232 if (unlikely(__pyx_t_9 != -1)) {
6233 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6234 __PYX_ERR(0, 214, __pyx_L1_error)
6236 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6245 __pyx_t_14 = (__pyx_v_x->dimensions[2]);
6246 __pyx_t_15 = __pyx_t_14;
6247 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_15; __pyx_t_9+=1) {
6248 __pyx_v_k = __pyx_t_9;
6257 if (unlikely(__pyx_v_material_functions == Py_None)) {
6258 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6259 __PYX_ERR(0, 216, __pyx_L1_error)
6261 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
6262 __Pyx_GOTREF(__pyx_t_17);
6263 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 216, __pyx_L1_error)
6264 __Pyx_GOTREF(__pyx_t_18);
6265 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6266 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
6267 __Pyx_GOTREF(__pyx_t_17);
6268 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 216, __pyx_L1_error)
6269 __Pyx_GOTREF(__pyx_t_19);
6270 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 216, __pyx_L1_error)
6271 __Pyx_GOTREF(__pyx_t_20);
6272 __pyx_t_21 = PyTuple_New(3);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 216, __pyx_L1_error)
6273 __Pyx_GOTREF(__pyx_t_21);
6274 __Pyx_GIVEREF(__pyx_t_17);
6275 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_17);
6276 __Pyx_GIVEREF(__pyx_t_19);
6277 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_19);
6278 __Pyx_GIVEREF(__pyx_t_20);
6279 PyTuple_SET_ITEM(__pyx_t_21, 2, __pyx_t_20);
6283 __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_21);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 216, __pyx_L1_error)
6284 __Pyx_GOTREF(__pyx_t_20);
6285 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6286 __pyx_t_21 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 216, __pyx_L1_error)
6287 __Pyx_GOTREF(__pyx_t_21);
6290 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_18))) {
6291 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_18);
6292 if (likely(__pyx_t_19)) {
6293 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_18);
6294 __Pyx_INCREF(__pyx_t_19);
6295 __Pyx_INCREF(
function);
6296 __Pyx_DECREF_SET(__pyx_t_18,
function);
6300 #if CYTHON_FAST_PYCALL 6301 if (PyFunction_Check(__pyx_t_18)) {
6302 PyObject *__pyx_temp[3] = {__pyx_t_19, __pyx_t_20, __pyx_t_21};
6303 __pyx_t_16 = __Pyx_PyFunction_FastCall(__pyx_t_18, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 216, __pyx_L1_error)
6304 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
6305 __Pyx_GOTREF(__pyx_t_16);
6306 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6307 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6310 #if CYTHON_FAST_PYCCALL 6311 if (__Pyx_PyFastCFunction_Check(__pyx_t_18)) {
6312 PyObject *__pyx_temp[3] = {__pyx_t_19, __pyx_t_20, __pyx_t_21};
6313 __pyx_t_16 = __Pyx_PyCFunction_FastCall(__pyx_t_18, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 216, __pyx_L1_error)
6314 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
6315 __Pyx_GOTREF(__pyx_t_16);
6316 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6317 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6321 __pyx_t_17 = PyTuple_New(2+__pyx_t_22);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
6322 __Pyx_GOTREF(__pyx_t_17);
6324 __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_19); __pyx_t_19 = NULL;
6326 __Pyx_GIVEREF(__pyx_t_20);
6327 PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_22, __pyx_t_20);
6328 __Pyx_GIVEREF(__pyx_t_21);
6329 PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_22, __pyx_t_21);
6332 __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_17, NULL);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 216, __pyx_L1_error)
6333 __Pyx_GOTREF(__pyx_t_16);
6334 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6336 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6345 if (unlikely(__pyx_v_material_functions == Py_None)) {
6346 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6347 __PYX_ERR(0, 217, __pyx_L1_error)
6349 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 217, __pyx_L1_error)
6350 __Pyx_GOTREF(__pyx_t_17);
6351 __pyx_t_21 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 217, __pyx_L1_error)
6352 __Pyx_GOTREF(__pyx_t_21);
6353 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6354 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 217, __pyx_L1_error)
6355 __Pyx_GOTREF(__pyx_t_17);
6356 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 217, __pyx_L1_error)
6357 __Pyx_GOTREF(__pyx_t_20);
6358 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 217, __pyx_L1_error)
6359 __Pyx_GOTREF(__pyx_t_19);
6360 __pyx_t_23 = PyTuple_New(3);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 217, __pyx_L1_error)
6361 __Pyx_GOTREF(__pyx_t_23);
6362 __Pyx_GIVEREF(__pyx_t_17);
6363 PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_17);
6364 __Pyx_GIVEREF(__pyx_t_20);
6365 PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_20);
6366 __Pyx_GIVEREF(__pyx_t_19);
6367 PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_t_19);
6371 __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_23);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 217, __pyx_L1_error)
6372 __Pyx_GOTREF(__pyx_t_19);
6373 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
6374 __pyx_t_23 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 217, __pyx_L1_error)
6375 __Pyx_GOTREF(__pyx_t_23);
6378 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_21))) {
6379 __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_21);
6380 if (likely(__pyx_t_20)) {
6381 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_21);
6382 __Pyx_INCREF(__pyx_t_20);
6383 __Pyx_INCREF(
function);
6384 __Pyx_DECREF_SET(__pyx_t_21,
function);
6388 #if CYTHON_FAST_PYCALL 6389 if (PyFunction_Check(__pyx_t_21)) {
6390 PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_19, __pyx_t_23};
6391 __pyx_t_18 = __Pyx_PyFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 217, __pyx_L1_error)
6392 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
6393 __Pyx_GOTREF(__pyx_t_18);
6394 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6395 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
6398 #if CYTHON_FAST_PYCCALL 6399 if (__Pyx_PyFastCFunction_Check(__pyx_t_21)) {
6400 PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_19, __pyx_t_23};
6401 __pyx_t_18 = __Pyx_PyCFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 217, __pyx_L1_error)
6402 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
6403 __Pyx_GOTREF(__pyx_t_18);
6404 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6405 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
6409 __pyx_t_17 = PyTuple_New(2+__pyx_t_22);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 217, __pyx_L1_error)
6410 __Pyx_GOTREF(__pyx_t_17);
6412 __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_20); __pyx_t_20 = NULL;
6414 __Pyx_GIVEREF(__pyx_t_19);
6415 PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_22, __pyx_t_19);
6416 __Pyx_GIVEREF(__pyx_t_23);
6417 PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_22, __pyx_t_23);
6420 __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_17, NULL);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 217, __pyx_L1_error)
6421 __Pyx_GOTREF(__pyx_t_18);
6422 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6424 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6433 __pyx_t_21 = PyNumber_Add(__pyx_t_16, __pyx_t_18);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 216, __pyx_L1_error)
6434 __Pyx_GOTREF(__pyx_t_21);
6435 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6436 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6437 __pyx_t_18 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_21);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 216, __pyx_L1_error)
6438 __Pyx_GOTREF(__pyx_t_18);
6439 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6440 __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_18);
if (unlikely((__pyx_t_24 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L1_error)
6441 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6442 __pyx_t_25 = __pyx_v_eN;
6443 __pyx_t_26 = __pyx_v_ebN_local;
6444 __pyx_t_27 = __pyx_v_k;
6446 if (__pyx_t_25 < 0) {
6447 __pyx_t_25 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
6448 if (unlikely(__pyx_t_25 < 0)) __pyx_t_22 = 0;
6449 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_22 = 0;
6450 if (__pyx_t_26 < 0) {
6451 __pyx_t_26 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
6452 if (unlikely(__pyx_t_26 < 0)) __pyx_t_22 = 1;
6453 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_22 = 1;
6454 if (__pyx_t_27 < 0) {
6455 __pyx_t_27 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
6456 if (unlikely(__pyx_t_27 < 0)) __pyx_t_22 = 2;
6457 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_22 = 2;
6458 if (unlikely(__pyx_t_22 != -1)) {
6459 __Pyx_RaiseBufferIndexError(__pyx_t_22);
6460 __PYX_ERR(0, 216, __pyx_L1_error)
6462 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_27, __pyx_pybuffernd_ebq_vals.diminfo[2].strides) = __pyx_t_24;
6476 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6479 __Pyx_XDECREF(__pyx_t_16);
6480 __Pyx_XDECREF(__pyx_t_17);
6481 __Pyx_XDECREF(__pyx_t_18);
6482 __Pyx_XDECREF(__pyx_t_19);
6483 __Pyx_XDECREF(__pyx_t_20);
6484 __Pyx_XDECREF(__pyx_t_21);
6485 __Pyx_XDECREF(__pyx_t_23);
6486 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
6487 __Pyx_PyThreadState_declare
6488 __Pyx_PyThreadState_assign
6489 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
6490 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
6491 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
6492 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
6493 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6494 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
6495 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6499 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
6500 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
6501 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
6502 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6504 __Pyx_XGIVEREF(__pyx_r);
6505 __Pyx_RefNannyFinishContext();
6518 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6519 static char __pyx_doc_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn}(x,t) = f^L_{j,mn}(x,t)f^R_{k,mn}(x,t)/(f^L_{j,mn}(x,t)+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
6520 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage = {
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage};
6521 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6524 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
6525 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
6526 PyArrayObject *__pyx_v_x = 0;
6527 PyArrayObject *__pyx_v_ebq_vals = 0;
6528 PyObject *__pyx_v_material_functions = 0;
6529 PyObject *__pyx_r = 0;
6530 __Pyx_RefNannyDeclarations
6531 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage (wrapper)", 0);
6533 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
6534 PyObject* values[7] = {0,0,0,0,0,0,0};
6535 if (unlikely(__pyx_kwds)) {
6537 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6539 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6541 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6543 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6545 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6547 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6549 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6551 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6554 default:
goto __pyx_L5_argtuple_error;
6556 kw_args = PyDict_Size(__pyx_kwds);
6559 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
6560 else goto __pyx_L5_argtuple_error;
6563 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
6565 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 1); __PYX_ERR(0, 219, __pyx_L3_error)
6569 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
6571 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 2); __PYX_ERR(0, 219, __pyx_L3_error)
6575 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
6577 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 3); __PYX_ERR(0, 219, __pyx_L3_error)
6581 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
6583 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 4); __PYX_ERR(0, 219, __pyx_L3_error)
6587 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
6589 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 5); __PYX_ERR(0, 219, __pyx_L3_error)
6593 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
6595 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 6); __PYX_ERR(0, 219, __pyx_L3_error)
6598 if (unlikely(kw_args > 0)) {
6599 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 219, __pyx_L3_error)
6601 }
else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
6602 goto __pyx_L5_argtuple_error;
6604 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6605 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6606 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6607 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6608 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6609 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6610 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6612 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 219, __pyx_L3_error)
6613 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L3_error)
6614 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[2]);
6615 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[3]);
6616 __pyx_v_x = ((PyArrayObject *)values[4]);
6617 __pyx_v_ebq_vals = ((PyArrayObject *)values[5]);
6618 __pyx_v_material_functions = ((PyObject*)values[6]);
6620 goto __pyx_L4_argument_unpacking_done;
6621 __pyx_L5_argtuple_error:;
6622 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 219, __pyx_L3_error)
6624 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6625 __Pyx_RefNannyFinishContext();
6627 __pyx_L4_argument_unpacking_done:;
6628 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 221, __pyx_L1_error)
6629 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 222, __pyx_L1_error)
6630 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 223, __pyx_L1_error)
6631 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 224, __pyx_L1_error)
6632 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 225, __pyx_L1_error)
6633 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_vals, __pyx_v_material_functions);
6640 __Pyx_RefNannyFinishContext();
6644 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
6647 int __pyx_v_ebN_local;
6649 int __pyx_v_material_left;
6650 int __pyx_v_material_right;
6653 double __pyx_v_numer;
6654 double __pyx_v_denom;
6655 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
6656 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
6657 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
6658 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
6659 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
6660 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
6661 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
6662 __Pyx_Buffer __pyx_pybuffer_x;
6663 PyObject *__pyx_r = NULL;
6664 __Pyx_RefNannyDeclarations
6671 Py_ssize_t __pyx_t_7;
6672 Py_ssize_t __pyx_t_8;
6674 Py_ssize_t __pyx_t_10;
6675 Py_ssize_t __pyx_t_11;
6676 Py_ssize_t __pyx_t_12;
6677 Py_ssize_t __pyx_t_13;
6678 npy_intp __pyx_t_14;
6679 npy_intp __pyx_t_15;
6686 PyObject *__pyx_t_22 = NULL;
6687 PyObject *__pyx_t_23 = NULL;
6688 PyObject *__pyx_t_24 = NULL;
6689 PyObject *__pyx_t_25 = NULL;
6690 PyObject *__pyx_t_26 = NULL;
6691 PyObject *__pyx_t_27 = NULL;
6693 PyObject *__pyx_t_29 = NULL;
6695 Py_ssize_t __pyx_t_31;
6696 Py_ssize_t __pyx_t_32;
6697 Py_ssize_t __pyx_t_33;
6698 Py_ssize_t __pyx_t_34;
6699 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 0);
6700 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
6701 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
6702 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
6703 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
6704 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
6705 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
6706 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
6707 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
6708 __pyx_pybuffer_x.pybuffer.buf = NULL;
6709 __pyx_pybuffer_x.refcount = 0;
6710 __pyx_pybuffernd_x.data = NULL;
6711 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
6712 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
6713 __pyx_pybuffer_ebq_vals.refcount = 0;
6714 __pyx_pybuffernd_ebq_vals.data = NULL;
6715 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
6717 __Pyx_BufFmt_StackElem __pyx_stack[1];
6718 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6720 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
6722 __Pyx_BufFmt_StackElem __pyx_stack[1];
6723 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6725 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
6727 __Pyx_BufFmt_StackElem __pyx_stack[1];
6728 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6730 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
6732 __Pyx_BufFmt_StackElem __pyx_stack[1];
6733 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6735 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_ebq_vals.diminfo[3].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_ebq_vals.diminfo[3].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[3];
6744 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
6745 __pyx_t_2 = __pyx_t_1;
6746 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
6747 __pyx_v_eN = __pyx_t_3;
6756 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
6757 __pyx_t_5 = __pyx_t_4;
6758 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
6759 __pyx_v_ebN_local = __pyx_t_6;
6768 __pyx_t_7 = __pyx_v_eN;
6769 __pyx_t_8 = __pyx_v_ebN_local;
6771 if (__pyx_t_7 < 0) {
6772 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
6773 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
6774 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
6775 if (__pyx_t_8 < 0) {
6776 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
6777 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
6778 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
6779 if (unlikely(__pyx_t_9 != -1)) {
6780 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6781 __PYX_ERR(0, 238, __pyx_L1_error)
6783 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
6792 __pyx_t_10 = __pyx_v_ebN;
6795 if (__pyx_t_10 < 0) {
6796 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6797 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
6798 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6799 if (__pyx_t_11 < 0) {
6800 __pyx_t_11 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6801 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
6802 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6803 if (unlikely(__pyx_t_9 != -1)) {
6804 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6805 __PYX_ERR(0, 239, __pyx_L1_error)
6807 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6816 __pyx_t_12 = __pyx_v_ebN;
6819 if (__pyx_t_12 < 0) {
6820 __pyx_t_12 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6821 if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 0;
6822 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6823 if (__pyx_t_13 < 0) {
6824 __pyx_t_13 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6825 if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 1;
6826 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6827 if (unlikely(__pyx_t_9 != -1)) {
6828 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6829 __PYX_ERR(0, 240, __pyx_L1_error)
6831 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6840 __pyx_t_14 = (__pyx_v_x->dimensions[2]);
6841 __pyx_t_15 = __pyx_t_14;
6842 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_15; __pyx_t_9+=1) {
6843 __pyx_v_k = __pyx_t_9;
6852 __pyx_t_16 = __pyx_v_nd;
6853 __pyx_t_17 = __pyx_t_16;
6854 for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
6855 __pyx_v_I = __pyx_t_18;
6864 __pyx_t_19 = __pyx_v_nd;
6865 __pyx_t_20 = __pyx_t_19;
6866 for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
6867 __pyx_v_J = __pyx_t_21;
6876 if (unlikely(__pyx_v_material_functions == Py_None)) {
6877 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6878 __PYX_ERR(0, 244, __pyx_L1_error)
6880 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
6881 __Pyx_GOTREF(__pyx_t_23);
6882 __pyx_t_24 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_23);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 244, __pyx_L1_error)
6883 __Pyx_GOTREF(__pyx_t_24);
6884 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
6885 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
6886 __Pyx_GOTREF(__pyx_t_23);
6887 __pyx_t_25 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 244, __pyx_L1_error)
6888 __Pyx_GOTREF(__pyx_t_25);
6889 __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 244, __pyx_L1_error)
6890 __Pyx_GOTREF(__pyx_t_26);
6891 __pyx_t_27 = PyTuple_New(3);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 244, __pyx_L1_error)
6892 __Pyx_GOTREF(__pyx_t_27);
6893 __Pyx_GIVEREF(__pyx_t_23);
6894 PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_23);
6895 __Pyx_GIVEREF(__pyx_t_25);
6896 PyTuple_SET_ITEM(__pyx_t_27, 1, __pyx_t_25);
6897 __Pyx_GIVEREF(__pyx_t_26);
6898 PyTuple_SET_ITEM(__pyx_t_27, 2, __pyx_t_26);
6902 __pyx_t_26 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_27);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 244, __pyx_L1_error)
6903 __Pyx_GOTREF(__pyx_t_26);
6904 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
6905 __pyx_t_27 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 244, __pyx_L1_error)
6906 __Pyx_GOTREF(__pyx_t_27);
6909 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_24))) {
6910 __pyx_t_25 = PyMethod_GET_SELF(__pyx_t_24);
6911 if (likely(__pyx_t_25)) {
6912 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_24);
6913 __Pyx_INCREF(__pyx_t_25);
6914 __Pyx_INCREF(
function);
6915 __Pyx_DECREF_SET(__pyx_t_24,
function);
6919 #if CYTHON_FAST_PYCALL 6920 if (PyFunction_Check(__pyx_t_24)) {
6921 PyObject *__pyx_temp[3] = {__pyx_t_25, __pyx_t_26, __pyx_t_27};
6922 __pyx_t_22 = __Pyx_PyFunction_FastCall(__pyx_t_24, __pyx_temp+1-__pyx_t_28, 2+__pyx_t_28);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6923 __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
6924 __Pyx_GOTREF(__pyx_t_22);
6925 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
6926 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
6929 #if CYTHON_FAST_PYCCALL 6930 if (__Pyx_PyFastCFunction_Check(__pyx_t_24)) {
6931 PyObject *__pyx_temp[3] = {__pyx_t_25, __pyx_t_26, __pyx_t_27};
6932 __pyx_t_22 = __Pyx_PyCFunction_FastCall(__pyx_t_24, __pyx_temp+1-__pyx_t_28, 2+__pyx_t_28);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6933 __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
6934 __Pyx_GOTREF(__pyx_t_22);
6935 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
6936 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
6940 __pyx_t_23 = PyTuple_New(2+__pyx_t_28);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
6941 __Pyx_GOTREF(__pyx_t_23);
6943 __Pyx_GIVEREF(__pyx_t_25); PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_25); __pyx_t_25 = NULL;
6945 __Pyx_GIVEREF(__pyx_t_26);
6946 PyTuple_SET_ITEM(__pyx_t_23, 0+__pyx_t_28, __pyx_t_26);
6947 __Pyx_GIVEREF(__pyx_t_27);
6948 PyTuple_SET_ITEM(__pyx_t_23, 1+__pyx_t_28, __pyx_t_27);
6951 __pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_23, NULL);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6952 __Pyx_GOTREF(__pyx_t_22);
6953 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
6955 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6956 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 244, __pyx_L1_error)
6957 __Pyx_GOTREF(__pyx_t_24);
6958 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
6959 __Pyx_GOTREF(__pyx_t_23);
6960 __pyx_t_27 = PyTuple_New(2);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 244, __pyx_L1_error)
6961 __Pyx_GOTREF(__pyx_t_27);
6962 __Pyx_GIVEREF(__pyx_t_24);
6963 PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_24);
6964 __Pyx_GIVEREF(__pyx_t_23);
6965 PyTuple_SET_ITEM(__pyx_t_27, 1, __pyx_t_23);
6968 __pyx_t_23 = __Pyx_PyObject_GetItem(__pyx_t_22, __pyx_t_27);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
6969 __Pyx_GOTREF(__pyx_t_23);
6970 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6971 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
6972 __pyx_t_27 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_23);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 244, __pyx_L1_error)
6973 __Pyx_GOTREF(__pyx_t_27);
6974 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
6975 if (unlikely(__pyx_v_material_functions == Py_None)) {
6976 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6977 __PYX_ERR(0, 244, __pyx_L1_error)
6979 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6980 __Pyx_GOTREF(__pyx_t_22);
6981 __pyx_t_24 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_22);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 244, __pyx_L1_error)
6982 __Pyx_GOTREF(__pyx_t_24);
6983 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6984 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6985 __Pyx_GOTREF(__pyx_t_22);
6986 __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 244, __pyx_L1_error)
6987 __Pyx_GOTREF(__pyx_t_26);
6988 __pyx_t_25 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 244, __pyx_L1_error)
6989 __Pyx_GOTREF(__pyx_t_25);
6990 __pyx_t_29 = PyTuple_New(3);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 244, __pyx_L1_error)
6991 __Pyx_GOTREF(__pyx_t_29);
6992 __Pyx_GIVEREF(__pyx_t_22);
6993 PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_22);
6994 __Pyx_GIVEREF(__pyx_t_26);
6995 PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_26);
6996 __Pyx_GIVEREF(__pyx_t_25);
6997 PyTuple_SET_ITEM(__pyx_t_29, 2, __pyx_t_25);
7001 __pyx_t_25 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_29);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 244, __pyx_L1_error)
7002 __Pyx_GOTREF(__pyx_t_25);
7003 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
7004 __pyx_t_29 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 244, __pyx_L1_error)
7005 __Pyx_GOTREF(__pyx_t_29);
7008 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_24))) {
7009 __pyx_t_26 = PyMethod_GET_SELF(__pyx_t_24);
7010 if (likely(__pyx_t_26)) {
7011 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_24);
7012 __Pyx_INCREF(__pyx_t_26);
7013 __Pyx_INCREF(
function);
7014 __Pyx_DECREF_SET(__pyx_t_24,
function);
7018 #if CYTHON_FAST_PYCALL 7019 if (PyFunction_Check(__pyx_t_24)) {
7020 PyObject *__pyx_temp[3] = {__pyx_t_26, __pyx_t_25, __pyx_t_29};
7021 __pyx_t_23 = __Pyx_PyFunction_FastCall(__pyx_t_24, __pyx_temp+1-__pyx_t_28, 2+__pyx_t_28);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
7022 __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
7023 __Pyx_GOTREF(__pyx_t_23);
7024 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7025 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
7028 #if CYTHON_FAST_PYCCALL 7029 if (__Pyx_PyFastCFunction_Check(__pyx_t_24)) {
7030 PyObject *__pyx_temp[3] = {__pyx_t_26, __pyx_t_25, __pyx_t_29};
7031 __pyx_t_23 = __Pyx_PyCFunction_FastCall(__pyx_t_24, __pyx_temp+1-__pyx_t_28, 2+__pyx_t_28);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
7032 __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
7033 __Pyx_GOTREF(__pyx_t_23);
7034 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7035 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
7039 __pyx_t_22 = PyTuple_New(2+__pyx_t_28);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
7040 __Pyx_GOTREF(__pyx_t_22);
7042 __Pyx_GIVEREF(__pyx_t_26); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_26); __pyx_t_26 = NULL;
7044 __Pyx_GIVEREF(__pyx_t_25);
7045 PyTuple_SET_ITEM(__pyx_t_22, 0+__pyx_t_28, __pyx_t_25);
7046 __Pyx_GIVEREF(__pyx_t_29);
7047 PyTuple_SET_ITEM(__pyx_t_22, 1+__pyx_t_28, __pyx_t_29);
7050 __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_22, NULL);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
7051 __Pyx_GOTREF(__pyx_t_23);
7052 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7054 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
7055 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 244, __pyx_L1_error)
7056 __Pyx_GOTREF(__pyx_t_24);
7057 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
7058 __Pyx_GOTREF(__pyx_t_22);
7059 __pyx_t_29 = PyTuple_New(2);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 244, __pyx_L1_error)
7060 __Pyx_GOTREF(__pyx_t_29);
7061 __Pyx_GIVEREF(__pyx_t_24);
7062 PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_24);
7063 __Pyx_GIVEREF(__pyx_t_22);
7064 PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_22);
7067 __pyx_t_22 = __Pyx_PyObject_GetItem(__pyx_t_23, __pyx_t_29);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
7068 __Pyx_GOTREF(__pyx_t_22);
7069 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7070 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
7071 __pyx_t_29 = PyNumber_Multiply(__pyx_t_27, __pyx_t_22);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 244, __pyx_L1_error)
7072 __Pyx_GOTREF(__pyx_t_29);
7073 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
7074 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7075 __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_t_29);
if (unlikely((__pyx_t_30 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L1_error)
7076 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
7077 __pyx_v_numer = __pyx_t_30;
7086 if (unlikely(__pyx_v_material_functions == Py_None)) {
7087 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7088 __PYX_ERR(0, 245, __pyx_L1_error)
7090 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7091 __Pyx_GOTREF(__pyx_t_22);
7092 __pyx_t_27 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_22);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 245, __pyx_L1_error)
7093 __Pyx_GOTREF(__pyx_t_27);
7094 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7095 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7096 __Pyx_GOTREF(__pyx_t_22);
7097 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
7098 __Pyx_GOTREF(__pyx_t_23);
7099 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
7100 __Pyx_GOTREF(__pyx_t_24);
7101 __pyx_t_25 = PyTuple_New(3);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7102 __Pyx_GOTREF(__pyx_t_25);
7103 __Pyx_GIVEREF(__pyx_t_22);
7104 PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_22);
7105 __Pyx_GIVEREF(__pyx_t_23);
7106 PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_t_23);
7107 __Pyx_GIVEREF(__pyx_t_24);
7108 PyTuple_SET_ITEM(__pyx_t_25, 2, __pyx_t_24);
7112 __pyx_t_24 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_25);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
7113 __Pyx_GOTREF(__pyx_t_24);
7114 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7115 __pyx_t_25 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7116 __Pyx_GOTREF(__pyx_t_25);
7119 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_27))) {
7120 __pyx_t_23 = PyMethod_GET_SELF(__pyx_t_27);
7121 if (likely(__pyx_t_23)) {
7122 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_27);
7123 __Pyx_INCREF(__pyx_t_23);
7124 __Pyx_INCREF(
function);
7125 __Pyx_DECREF_SET(__pyx_t_27,
function);
7129 #if CYTHON_FAST_PYCALL 7130 if (PyFunction_Check(__pyx_t_27)) {
7131 PyObject *__pyx_temp[3] = {__pyx_t_23, __pyx_t_24, __pyx_t_25};
7132 __pyx_t_29 = __Pyx_PyFunction_FastCall(__pyx_t_27, __pyx_temp+1-__pyx_t_28, 2+__pyx_t_28);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 245, __pyx_L1_error)
7133 __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
7134 __Pyx_GOTREF(__pyx_t_29);
7135 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
7136 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7139 #if CYTHON_FAST_PYCCALL 7140 if (__Pyx_PyFastCFunction_Check(__pyx_t_27)) {
7141 PyObject *__pyx_temp[3] = {__pyx_t_23, __pyx_t_24, __pyx_t_25};
7142 __pyx_t_29 = __Pyx_PyCFunction_FastCall(__pyx_t_27, __pyx_temp+1-__pyx_t_28, 2+__pyx_t_28);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 245, __pyx_L1_error)
7143 __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
7144 __Pyx_GOTREF(__pyx_t_29);
7145 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
7146 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7150 __pyx_t_22 = PyTuple_New(2+__pyx_t_28);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7151 __Pyx_GOTREF(__pyx_t_22);
7153 __Pyx_GIVEREF(__pyx_t_23); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_23); __pyx_t_23 = NULL;
7155 __Pyx_GIVEREF(__pyx_t_24);
7156 PyTuple_SET_ITEM(__pyx_t_22, 0+__pyx_t_28, __pyx_t_24);
7157 __Pyx_GIVEREF(__pyx_t_25);
7158 PyTuple_SET_ITEM(__pyx_t_22, 1+__pyx_t_28, __pyx_t_25);
7161 __pyx_t_29 = __Pyx_PyObject_Call(__pyx_t_27, __pyx_t_22, NULL);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 245, __pyx_L1_error)
7162 __Pyx_GOTREF(__pyx_t_29);
7163 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7165 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
7166 __pyx_t_27 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 245, __pyx_L1_error)
7167 __Pyx_GOTREF(__pyx_t_27);
7168 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7169 __Pyx_GOTREF(__pyx_t_22);
7170 __pyx_t_25 = PyTuple_New(2);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7171 __Pyx_GOTREF(__pyx_t_25);
7172 __Pyx_GIVEREF(__pyx_t_27);
7173 PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_27);
7174 __Pyx_GIVEREF(__pyx_t_22);
7175 PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_t_22);
7178 __pyx_t_22 = __Pyx_PyObject_GetItem(__pyx_t_29, __pyx_t_25);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7179 __Pyx_GOTREF(__pyx_t_22);
7180 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
7181 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7182 if (unlikely(__pyx_v_material_functions == Py_None)) {
7183 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7184 __PYX_ERR(0, 245, __pyx_L1_error)
7186 __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 245, __pyx_L1_error)
7187 __Pyx_GOTREF(__pyx_t_29);
7188 __pyx_t_27 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_29);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 245, __pyx_L1_error)
7189 __Pyx_GOTREF(__pyx_t_27);
7190 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
7191 __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 245, __pyx_L1_error)
7192 __Pyx_GOTREF(__pyx_t_29);
7193 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
7194 __Pyx_GOTREF(__pyx_t_24);
7195 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
7196 __Pyx_GOTREF(__pyx_t_23);
7197 __pyx_t_26 = PyTuple_New(3);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 245, __pyx_L1_error)
7198 __Pyx_GOTREF(__pyx_t_26);
7199 __Pyx_GIVEREF(__pyx_t_29);
7200 PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_29);
7201 __Pyx_GIVEREF(__pyx_t_24);
7202 PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_t_24);
7203 __Pyx_GIVEREF(__pyx_t_23);
7204 PyTuple_SET_ITEM(__pyx_t_26, 2, __pyx_t_23);
7208 __pyx_t_23 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_26);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
7209 __Pyx_GOTREF(__pyx_t_23);
7210 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
7211 __pyx_t_26 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 245, __pyx_L1_error)
7212 __Pyx_GOTREF(__pyx_t_26);
7215 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_27))) {
7216 __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_27);
7217 if (likely(__pyx_t_24)) {
7218 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_27);
7219 __Pyx_INCREF(__pyx_t_24);
7220 __Pyx_INCREF(
function);
7221 __Pyx_DECREF_SET(__pyx_t_27,
function);
7225 #if CYTHON_FAST_PYCALL 7226 if (PyFunction_Check(__pyx_t_27)) {
7227 PyObject *__pyx_temp[3] = {__pyx_t_24, __pyx_t_23, __pyx_t_26};
7228 __pyx_t_25 = __Pyx_PyFunction_FastCall(__pyx_t_27, __pyx_temp+1-__pyx_t_28, 2+__pyx_t_28);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7229 __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
7230 __Pyx_GOTREF(__pyx_t_25);
7231 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7232 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
7235 #if CYTHON_FAST_PYCCALL 7236 if (__Pyx_PyFastCFunction_Check(__pyx_t_27)) {
7237 PyObject *__pyx_temp[3] = {__pyx_t_24, __pyx_t_23, __pyx_t_26};
7238 __pyx_t_25 = __Pyx_PyCFunction_FastCall(__pyx_t_27, __pyx_temp+1-__pyx_t_28, 2+__pyx_t_28);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7239 __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
7240 __Pyx_GOTREF(__pyx_t_25);
7241 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7242 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
7246 __pyx_t_29 = PyTuple_New(2+__pyx_t_28);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 245, __pyx_L1_error)
7247 __Pyx_GOTREF(__pyx_t_29);
7249 __Pyx_GIVEREF(__pyx_t_24); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_24); __pyx_t_24 = NULL;
7251 __Pyx_GIVEREF(__pyx_t_23);
7252 PyTuple_SET_ITEM(__pyx_t_29, 0+__pyx_t_28, __pyx_t_23);
7253 __Pyx_GIVEREF(__pyx_t_26);
7254 PyTuple_SET_ITEM(__pyx_t_29, 1+__pyx_t_28, __pyx_t_26);
7257 __pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_27, __pyx_t_29, NULL);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7258 __Pyx_GOTREF(__pyx_t_25);
7259 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
7261 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
7262 __pyx_t_27 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 245, __pyx_L1_error)
7263 __Pyx_GOTREF(__pyx_t_27);
7264 __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 245, __pyx_L1_error)
7265 __Pyx_GOTREF(__pyx_t_29);
7266 __pyx_t_26 = PyTuple_New(2);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 245, __pyx_L1_error)
7267 __Pyx_GOTREF(__pyx_t_26);
7268 __Pyx_GIVEREF(__pyx_t_27);
7269 PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_27);
7270 __Pyx_GIVEREF(__pyx_t_29);
7271 PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_t_29);
7274 __pyx_t_29 = __Pyx_PyObject_GetItem(__pyx_t_25, __pyx_t_26);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 245, __pyx_L1_error)
7275 __Pyx_GOTREF(__pyx_t_29);
7276 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7277 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
7278 __pyx_t_26 = PyNumber_Add(__pyx_t_22, __pyx_t_29);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 245, __pyx_L1_error)
7279 __Pyx_GOTREF(__pyx_t_26);
7280 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7281 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
7282 __pyx_t_29 = __Pyx_PyFloat_AddObjC(__pyx_t_26, __pyx_float_1_0eneg_20, 1.0e-20, 0, 0);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 245, __pyx_L1_error)
7283 __Pyx_GOTREF(__pyx_t_29);
7284 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
7285 __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_t_29);
if (unlikely((__pyx_t_30 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L1_error)
7286 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
7287 __pyx_v_denom = __pyx_t_30;
7296 if (unlikely(__pyx_v_denom == 0)) {
7297 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
7298 __PYX_ERR(0, 246, __pyx_L1_error)
7300 __pyx_t_31 = __pyx_v_eN;
7301 __pyx_t_32 = __pyx_v_ebN_local;
7302 __pyx_t_33 = __pyx_v_k;
7303 __pyx_t_34 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
7305 if (__pyx_t_31 < 0) {
7306 __pyx_t_31 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
7307 if (unlikely(__pyx_t_31 < 0)) __pyx_t_28 = 0;
7308 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_28 = 0;
7309 if (__pyx_t_32 < 0) {
7310 __pyx_t_32 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
7311 if (unlikely(__pyx_t_32 < 0)) __pyx_t_28 = 1;
7312 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_28 = 1;
7313 if (__pyx_t_33 < 0) {
7314 __pyx_t_33 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
7315 if (unlikely(__pyx_t_33 < 0)) __pyx_t_28 = 2;
7316 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_28 = 2;
7317 if (__pyx_t_34 < 0) {
7318 __pyx_t_34 += __pyx_pybuffernd_ebq_vals.diminfo[3].shape;
7319 if (unlikely(__pyx_t_34 < 0)) __pyx_t_28 = 3;
7320 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_ebq_vals.diminfo[3].shape)) __pyx_t_28 = 3;
7321 if (unlikely(__pyx_t_28 != -1)) {
7322 __Pyx_RaiseBufferIndexError(__pyx_t_28);
7323 __PYX_ERR(0, 246, __pyx_L1_error)
7325 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_ebq_vals.diminfo[2].strides, __pyx_t_34, __pyx_pybuffernd_ebq_vals.diminfo[3].strides) = (__pyx_v_numer / __pyx_v_denom);
7341 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7344 __Pyx_XDECREF(__pyx_t_22);
7345 __Pyx_XDECREF(__pyx_t_23);
7346 __Pyx_XDECREF(__pyx_t_24);
7347 __Pyx_XDECREF(__pyx_t_25);
7348 __Pyx_XDECREF(__pyx_t_26);
7349 __Pyx_XDECREF(__pyx_t_27);
7350 __Pyx_XDECREF(__pyx_t_29);
7351 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7352 __Pyx_PyThreadState_declare
7353 __Pyx_PyThreadState_assign
7354 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7355 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
7356 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7357 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7358 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7359 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7360 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7364 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
7365 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7366 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7367 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7369 __Pyx_XGIVEREF(__pyx_r);
7370 __Pyx_RefNannyFinishContext();
7383 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7384 static char __pyx_doc_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f(x,t) = 0.5(f^L_j(x,t)+f^R_k(x,t)) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
7385 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage = {
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage};
7386 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7388 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
7389 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
7390 PyArrayObject *__pyx_v_x = 0;
7391 PyArrayObject *__pyx_v_ebq_global_vals = 0;
7392 PyObject *__pyx_v_material_functions = 0;
7393 PyObject *__pyx_r = 0;
7394 __Pyx_RefNannyDeclarations
7395 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage (wrapper)", 0);
7397 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
7398 PyObject* values[6] = {0,0,0,0,0,0};
7399 if (unlikely(__pyx_kwds)) {
7401 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7403 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7405 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7407 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7409 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7411 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7413 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7416 default:
goto __pyx_L5_argtuple_error;
7418 kw_args = PyDict_Size(__pyx_kwds);
7421 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
7422 else goto __pyx_L5_argtuple_error;
7425 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
7427 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 1); __PYX_ERR(0, 248, __pyx_L3_error)
7431 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
7433 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 2); __PYX_ERR(0, 248, __pyx_L3_error)
7437 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
7439 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 3); __PYX_ERR(0, 248, __pyx_L3_error)
7443 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
7445 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 4); __PYX_ERR(0, 248, __pyx_L3_error)
7449 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
7451 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 5); __PYX_ERR(0, 248, __pyx_L3_error)
7454 if (unlikely(kw_args > 0)) {
7455 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 248, __pyx_L3_error)
7457 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
7458 goto __pyx_L5_argtuple_error;
7460 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7461 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7462 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7463 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7464 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7465 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7467 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L3_error)
7468 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
7469 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
7470 __pyx_v_x = ((PyArrayObject *)values[3]);
7471 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[4]);
7472 __pyx_v_material_functions = ((PyObject*)values[5]);
7474 goto __pyx_L4_argument_unpacking_done;
7475 __pyx_L5_argtuple_error:;
7476 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 248, __pyx_L3_error)
7478 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7479 __Pyx_RefNannyFinishContext();
7481 __pyx_L4_argument_unpacking_done:;
7482 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 249, __pyx_L1_error)
7483 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 250, __pyx_L1_error)
7484 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 251, __pyx_L1_error)
7485 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 252, __pyx_L1_error)
7486 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 253, __pyx_L1_error)
7487 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
7494 __Pyx_RefNannyFinishContext();
7498 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
7500 int __pyx_v_material_left;
7501 int __pyx_v_material_right;
7503 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
7504 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
7505 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
7506 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
7507 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
7508 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
7509 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
7510 __Pyx_Buffer __pyx_pybuffer_x;
7511 PyObject *__pyx_r = NULL;
7512 __Pyx_RefNannyDeclarations
7516 Py_ssize_t __pyx_t_4;
7517 Py_ssize_t __pyx_t_5;
7519 Py_ssize_t __pyx_t_7;
7520 Py_ssize_t __pyx_t_8;
7522 npy_intp __pyx_t_10;
7523 npy_intp __pyx_t_11;
7524 PyObject *__pyx_t_12 = NULL;
7525 PyObject *__pyx_t_13 = NULL;
7526 PyObject *__pyx_t_14 = NULL;
7527 PyObject *__pyx_t_15 = NULL;
7528 PyObject *__pyx_t_16 = NULL;
7529 PyObject *__pyx_t_17 = NULL;
7530 PyObject *__pyx_t_18 = NULL;
7531 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_19;
7532 Py_ssize_t __pyx_t_20;
7533 Py_ssize_t __pyx_t_21;
7534 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 0);
7535 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
7536 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
7537 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
7538 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
7539 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
7540 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
7541 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
7542 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
7543 __pyx_pybuffer_x.pybuffer.buf = NULL;
7544 __pyx_pybuffer_x.refcount = 0;
7545 __pyx_pybuffernd_x.data = NULL;
7546 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
7547 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
7548 __pyx_pybuffer_ebq_global_vals.refcount = 0;
7549 __pyx_pybuffernd_ebq_global_vals.data = NULL;
7550 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
7552 __Pyx_BufFmt_StackElem __pyx_stack[1];
7553 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7555 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
7557 __Pyx_BufFmt_StackElem __pyx_stack[1];
7558 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7560 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
7562 __Pyx_BufFmt_StackElem __pyx_stack[1];
7563 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7565 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
7567 __Pyx_BufFmt_StackElem __pyx_stack[1];
7568 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7570 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1];
7579 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
7580 __pyx_t_2 = __pyx_t_1;
7581 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
7582 __pyx_v_ebN = __pyx_t_3;
7591 __pyx_t_4 = __pyx_v_ebN;
7594 if (__pyx_t_4 < 0) {
7595 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
7596 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
7597 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
7598 if (__pyx_t_5 < 0) {
7599 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
7600 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
7601 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
7602 if (unlikely(__pyx_t_6 != -1)) {
7603 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7604 __PYX_ERR(0, 264, __pyx_L1_error)
7606 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
7615 __pyx_t_7 = __pyx_v_ebN;
7618 if (__pyx_t_7 < 0) {
7619 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
7620 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 0;
7621 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
7622 if (__pyx_t_8 < 0) {
7623 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
7624 if (unlikely(__pyx_t_8 < 0)) __pyx_t_6 = 1;
7625 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
7626 if (unlikely(__pyx_t_6 != -1)) {
7627 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7628 __PYX_ERR(0, 265, __pyx_L1_error)
7630 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
7639 __pyx_t_9 = (__pyx_v_x->dimensions[1]);
7640 __pyx_t_10 = __pyx_t_9;
7641 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
7642 __pyx_v_k = __pyx_t_11;
7651 if (unlikely(__pyx_v_material_functions == Py_None)) {
7652 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7653 __PYX_ERR(0, 267, __pyx_L1_error)
7655 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 267, __pyx_L1_error)
7656 __Pyx_GOTREF(__pyx_t_13);
7657 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 267, __pyx_L1_error)
7658 __Pyx_GOTREF(__pyx_t_14);
7659 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7660 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 267, __pyx_L1_error)
7661 __Pyx_GOTREF(__pyx_t_13);
7662 __pyx_t_15 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_k);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 267, __pyx_L1_error)
7663 __Pyx_GOTREF(__pyx_t_15);
7664 __pyx_t_16 = PyTuple_New(2);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 267, __pyx_L1_error)
7665 __Pyx_GOTREF(__pyx_t_16);
7666 __Pyx_GIVEREF(__pyx_t_13);
7667 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_13);
7668 __Pyx_GIVEREF(__pyx_t_15);
7669 PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_15);
7672 __pyx_t_15 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_16);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 267, __pyx_L1_error)
7673 __Pyx_GOTREF(__pyx_t_15);
7674 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7675 __pyx_t_16 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 267, __pyx_L1_error)
7676 __Pyx_GOTREF(__pyx_t_16);
7679 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
7680 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
7681 if (likely(__pyx_t_13)) {
7682 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_14);
7683 __Pyx_INCREF(__pyx_t_13);
7684 __Pyx_INCREF(
function);
7685 __Pyx_DECREF_SET(__pyx_t_14,
function);
7689 #if CYTHON_FAST_PYCALL 7690 if (PyFunction_Check(__pyx_t_14)) {
7691 PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_15, __pyx_t_16};
7692 __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 267, __pyx_L1_error)
7693 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
7694 __Pyx_GOTREF(__pyx_t_12);
7695 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7696 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7699 #if CYTHON_FAST_PYCCALL 7700 if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
7701 PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_15, __pyx_t_16};
7702 __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 267, __pyx_L1_error)
7703 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
7704 __Pyx_GOTREF(__pyx_t_12);
7705 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7706 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7710 __pyx_t_17 = PyTuple_New(2+__pyx_t_6);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 267, __pyx_L1_error)
7711 __Pyx_GOTREF(__pyx_t_17);
7713 __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_13); __pyx_t_13 = NULL;
7715 __Pyx_GIVEREF(__pyx_t_15);
7716 PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_6, __pyx_t_15);
7717 __Pyx_GIVEREF(__pyx_t_16);
7718 PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_6, __pyx_t_16);
7721 __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_17, NULL);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 267, __pyx_L1_error)
7722 __Pyx_GOTREF(__pyx_t_12);
7723 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7725 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7734 if (unlikely(__pyx_v_material_functions == Py_None)) {
7735 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7736 __PYX_ERR(0, 268, __pyx_L1_error)
7738 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 268, __pyx_L1_error)
7739 __Pyx_GOTREF(__pyx_t_17);
7740 __pyx_t_16 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 268, __pyx_L1_error)
7741 __Pyx_GOTREF(__pyx_t_16);
7742 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7743 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 268, __pyx_L1_error)
7744 __Pyx_GOTREF(__pyx_t_17);
7745 __pyx_t_15 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_k);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 268, __pyx_L1_error)
7746 __Pyx_GOTREF(__pyx_t_15);
7747 __pyx_t_13 = PyTuple_New(2);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
7748 __Pyx_GOTREF(__pyx_t_13);
7749 __Pyx_GIVEREF(__pyx_t_17);
7750 PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_17);
7751 __Pyx_GIVEREF(__pyx_t_15);
7752 PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_15);
7755 __pyx_t_15 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_13);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 268, __pyx_L1_error)
7756 __Pyx_GOTREF(__pyx_t_15);
7757 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7758 __pyx_t_13 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
7759 __Pyx_GOTREF(__pyx_t_13);
7762 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) {
7763 __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
7764 if (likely(__pyx_t_17)) {
7765 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_16);
7766 __Pyx_INCREF(__pyx_t_17);
7767 __Pyx_INCREF(
function);
7768 __Pyx_DECREF_SET(__pyx_t_16,
function);
7772 #if CYTHON_FAST_PYCALL 7773 if (PyFunction_Check(__pyx_t_16)) {
7774 PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_15, __pyx_t_13};
7775 __pyx_t_14 = __Pyx_PyFunction_FastCall(__pyx_t_16, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 268, __pyx_L1_error)
7776 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
7777 __Pyx_GOTREF(__pyx_t_14);
7778 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7779 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7782 #if CYTHON_FAST_PYCCALL 7783 if (__Pyx_PyFastCFunction_Check(__pyx_t_16)) {
7784 PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_15, __pyx_t_13};
7785 __pyx_t_14 = __Pyx_PyCFunction_FastCall(__pyx_t_16, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 268, __pyx_L1_error)
7786 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
7787 __Pyx_GOTREF(__pyx_t_14);
7788 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7789 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7793 __pyx_t_18 = PyTuple_New(2+__pyx_t_6);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 268, __pyx_L1_error)
7794 __Pyx_GOTREF(__pyx_t_18);
7796 __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_17); __pyx_t_17 = NULL;
7798 __Pyx_GIVEREF(__pyx_t_15);
7799 PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_6, __pyx_t_15);
7800 __Pyx_GIVEREF(__pyx_t_13);
7801 PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_6, __pyx_t_13);
7804 __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_18, NULL);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 268, __pyx_L1_error)
7805 __Pyx_GOTREF(__pyx_t_14);
7806 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7808 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7817 __pyx_t_16 = PyNumber_Add(__pyx_t_12, __pyx_t_14);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 267, __pyx_L1_error)
7818 __Pyx_GOTREF(__pyx_t_16);
7819 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7820 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7821 __pyx_t_14 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_16);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 267, __pyx_L1_error)
7822 __Pyx_GOTREF(__pyx_t_14);
7823 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7824 __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_14);
if (unlikely((__pyx_t_19 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L1_error)
7825 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7826 __pyx_t_20 = __pyx_v_ebN;
7827 __pyx_t_21 = __pyx_v_k;
7829 if (__pyx_t_20 < 0) {
7830 __pyx_t_20 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
7831 if (unlikely(__pyx_t_20 < 0)) __pyx_t_6 = 0;
7832 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_6 = 0;
7833 if (__pyx_t_21 < 0) {
7834 __pyx_t_21 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
7835 if (unlikely(__pyx_t_21 < 0)) __pyx_t_6 = 1;
7836 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_6 = 1;
7837 if (unlikely(__pyx_t_6 != -1)) {
7838 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7839 __PYX_ERR(0, 267, __pyx_L1_error)
7841 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides) = __pyx_t_19;
7854 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7857 __Pyx_XDECREF(__pyx_t_12);
7858 __Pyx_XDECREF(__pyx_t_13);
7859 __Pyx_XDECREF(__pyx_t_14);
7860 __Pyx_XDECREF(__pyx_t_15);
7861 __Pyx_XDECREF(__pyx_t_16);
7862 __Pyx_XDECREF(__pyx_t_17);
7863 __Pyx_XDECREF(__pyx_t_18);
7864 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7865 __Pyx_PyThreadState_declare
7866 __Pyx_PyThreadState_assign
7867 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7868 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
7869 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7870 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7871 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7872 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7873 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7877 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
7878 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7879 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7880 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7882 __Pyx_XGIVEREF(__pyx_r);
7883 __Pyx_RefNannyFinishContext();
7896 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7897 static char __pyx_doc_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn}(x,t) = f^L_{j,mn}(x,t)f^R_{k,mn}(x,t)/(f^L_{j,mn}(x,t)+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
7898 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage = {
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage};
7899 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7902 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
7903 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
7904 PyArrayObject *__pyx_v_x = 0;
7905 PyArrayObject *__pyx_v_ebq_global_vals = 0;
7906 PyObject *__pyx_v_material_functions = 0;
7907 PyObject *__pyx_r = 0;
7908 __Pyx_RefNannyDeclarations
7909 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage (wrapper)", 0);
7911 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
7912 PyObject* values[7] = {0,0,0,0,0,0,0};
7913 if (unlikely(__pyx_kwds)) {
7915 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7917 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7919 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7921 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7923 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7925 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7927 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7929 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7932 default:
goto __pyx_L5_argtuple_error;
7934 kw_args = PyDict_Size(__pyx_kwds);
7937 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
7938 else goto __pyx_L5_argtuple_error;
7941 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
7943 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 1); __PYX_ERR(0, 271, __pyx_L3_error)
7947 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
7949 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 2); __PYX_ERR(0, 271, __pyx_L3_error)
7953 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
7955 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 3); __PYX_ERR(0, 271, __pyx_L3_error)
7959 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
7961 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 4); __PYX_ERR(0, 271, __pyx_L3_error)
7965 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
7967 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 5); __PYX_ERR(0, 271, __pyx_L3_error)
7971 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
7973 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 6); __PYX_ERR(0, 271, __pyx_L3_error)
7976 if (unlikely(kw_args > 0)) {
7977 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 271, __pyx_L3_error)
7979 }
else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
7980 goto __pyx_L5_argtuple_error;
7982 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7983 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7984 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7985 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7986 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7987 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7988 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7990 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error)
7991 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L3_error)
7992 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[2]);
7993 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[3]);
7994 __pyx_v_x = ((PyArrayObject *)values[4]);
7995 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[5]);
7996 __pyx_v_material_functions = ((PyObject*)values[6]);
7998 goto __pyx_L4_argument_unpacking_done;
7999 __pyx_L5_argtuple_error:;
8000 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 271, __pyx_L3_error)
8002 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
8003 __Pyx_RefNannyFinishContext();
8005 __pyx_L4_argument_unpacking_done:;
8006 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 273, __pyx_L1_error)
8007 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 274, __pyx_L1_error)
8008 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 275, __pyx_L1_error)
8009 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 276, __pyx_L1_error)
8010 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 277, __pyx_L1_error)
8011 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
8018 __Pyx_RefNannyFinishContext();
8022 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
8025 int __pyx_v_material_left;
8026 int __pyx_v_material_right;
8029 double __pyx_v_numer;
8030 double __pyx_v_denom;
8031 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
8032 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
8033 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
8034 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
8035 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
8036 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
8037 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
8038 __Pyx_Buffer __pyx_pybuffer_x;
8039 PyObject *__pyx_r = NULL;
8040 __Pyx_RefNannyDeclarations
8044 Py_ssize_t __pyx_t_4;
8045 Py_ssize_t __pyx_t_5;
8047 Py_ssize_t __pyx_t_7;
8048 Py_ssize_t __pyx_t_8;
8050 npy_intp __pyx_t_10;
8057 PyObject *__pyx_t_17 = NULL;
8058 PyObject *__pyx_t_18 = NULL;
8059 PyObject *__pyx_t_19 = NULL;
8060 PyObject *__pyx_t_20 = NULL;
8061 PyObject *__pyx_t_21 = NULL;
8063 PyObject *__pyx_t_23 = NULL;
8064 PyObject *__pyx_t_24 = NULL;
8066 Py_ssize_t __pyx_t_26;
8067 Py_ssize_t __pyx_t_27;
8068 Py_ssize_t __pyx_t_28;
8069 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 0);
8070 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
8071 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
8072 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
8073 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
8074 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
8075 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
8076 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
8077 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
8078 __pyx_pybuffer_x.pybuffer.buf = NULL;
8079 __pyx_pybuffer_x.refcount = 0;
8080 __pyx_pybuffernd_x.data = NULL;
8081 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
8082 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
8083 __pyx_pybuffer_ebq_global_vals.refcount = 0;
8084 __pyx_pybuffernd_ebq_global_vals.data = NULL;
8085 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
8087 __Pyx_BufFmt_StackElem __pyx_stack[1];
8088 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
8090 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
8092 __Pyx_BufFmt_StackElem __pyx_stack[1];
8093 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
8095 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
8097 __Pyx_BufFmt_StackElem __pyx_stack[1];
8098 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
8100 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
8102 __Pyx_BufFmt_StackElem __pyx_stack[1];
8103 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
8105 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[2];
8114 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
8115 __pyx_t_2 = __pyx_t_1;
8116 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
8117 __pyx_v_ebN = __pyx_t_3;
8126 __pyx_t_4 = __pyx_v_ebN;
8129 if (__pyx_t_4 < 0) {
8130 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
8131 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
8132 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
8133 if (__pyx_t_5 < 0) {
8134 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
8135 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
8136 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
8137 if (unlikely(__pyx_t_6 != -1)) {
8138 __Pyx_RaiseBufferIndexError(__pyx_t_6);
8139 __PYX_ERR(0, 289, __pyx_L1_error)
8141 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
8150 __pyx_t_7 = __pyx_v_ebN;
8153 if (__pyx_t_7 < 0) {
8154 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
8155 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 0;
8156 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
8157 if (__pyx_t_8 < 0) {
8158 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
8159 if (unlikely(__pyx_t_8 < 0)) __pyx_t_6 = 1;
8160 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
8161 if (unlikely(__pyx_t_6 != -1)) {
8162 __Pyx_RaiseBufferIndexError(__pyx_t_6);
8163 __PYX_ERR(0, 290, __pyx_L1_error)
8165 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
8174 __pyx_t_9 = (__pyx_v_x->dimensions[1]);
8175 __pyx_t_10 = __pyx_t_9;
8176 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_10; __pyx_t_6+=1) {
8177 __pyx_v_k = __pyx_t_6;
8186 __pyx_t_11 = __pyx_v_nd;
8187 __pyx_t_12 = __pyx_t_11;
8188 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
8189 __pyx_v_I = __pyx_t_13;
8198 __pyx_t_14 = __pyx_v_nd;
8199 __pyx_t_15 = __pyx_t_14;
8200 for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
8201 __pyx_v_J = __pyx_t_16;
8210 if (unlikely(__pyx_v_material_functions == Py_None)) {
8211 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8212 __PYX_ERR(0, 294, __pyx_L1_error)
8214 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8215 __Pyx_GOTREF(__pyx_t_18);
8216 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8217 __Pyx_GOTREF(__pyx_t_19);
8218 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8219 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8220 __Pyx_GOTREF(__pyx_t_18);
8221 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 294, __pyx_L1_error)
8222 __Pyx_GOTREF(__pyx_t_20);
8223 __pyx_t_21 = PyTuple_New(2);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8224 __Pyx_GOTREF(__pyx_t_21);
8225 __Pyx_GIVEREF(__pyx_t_18);
8226 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_18);
8227 __Pyx_GIVEREF(__pyx_t_20);
8228 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_20);
8231 __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_21);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 294, __pyx_L1_error)
8232 __Pyx_GOTREF(__pyx_t_20);
8233 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8234 __pyx_t_21 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8235 __Pyx_GOTREF(__pyx_t_21);
8238 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
8239 __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_19);
8240 if (likely(__pyx_t_18)) {
8241 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_19);
8242 __Pyx_INCREF(__pyx_t_18);
8243 __Pyx_INCREF(
function);
8244 __Pyx_DECREF_SET(__pyx_t_19,
function);
8248 #if CYTHON_FAST_PYCALL 8249 if (PyFunction_Check(__pyx_t_19)) {
8250 PyObject *__pyx_temp[3] = {__pyx_t_18, __pyx_t_20, __pyx_t_21};
8251 __pyx_t_17 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8252 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
8253 __Pyx_GOTREF(__pyx_t_17);
8254 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8255 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8258 #if CYTHON_FAST_PYCCALL 8259 if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
8260 PyObject *__pyx_temp[3] = {__pyx_t_18, __pyx_t_20, __pyx_t_21};
8261 __pyx_t_17 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8262 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
8263 __Pyx_GOTREF(__pyx_t_17);
8264 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8265 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8269 __pyx_t_23 = PyTuple_New(2+__pyx_t_22);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 294, __pyx_L1_error)
8270 __Pyx_GOTREF(__pyx_t_23);
8272 __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_18); __pyx_t_18 = NULL;
8274 __Pyx_GIVEREF(__pyx_t_20);
8275 PyTuple_SET_ITEM(__pyx_t_23, 0+__pyx_t_22, __pyx_t_20);
8276 __Pyx_GIVEREF(__pyx_t_21);
8277 PyTuple_SET_ITEM(__pyx_t_23, 1+__pyx_t_22, __pyx_t_21);
8280 __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_23, NULL);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8281 __Pyx_GOTREF(__pyx_t_17);
8282 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
8284 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8285 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8286 __Pyx_GOTREF(__pyx_t_19);
8287 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 294, __pyx_L1_error)
8288 __Pyx_GOTREF(__pyx_t_23);
8289 __pyx_t_21 = PyTuple_New(2);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8290 __Pyx_GOTREF(__pyx_t_21);
8291 __Pyx_GIVEREF(__pyx_t_19);
8292 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_19);
8293 __Pyx_GIVEREF(__pyx_t_23);
8294 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_23);
8297 __pyx_t_23 = __Pyx_PyObject_GetItem(__pyx_t_17, __pyx_t_21);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 294, __pyx_L1_error)
8298 __Pyx_GOTREF(__pyx_t_23);
8299 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8300 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8301 __pyx_t_21 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_23);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8302 __Pyx_GOTREF(__pyx_t_21);
8303 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
8304 if (unlikely(__pyx_v_material_functions == Py_None)) {
8305 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8306 __PYX_ERR(0, 294, __pyx_L1_error)
8308 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8309 __Pyx_GOTREF(__pyx_t_17);
8310 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8311 __Pyx_GOTREF(__pyx_t_19);
8312 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8313 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8314 __Pyx_GOTREF(__pyx_t_17);
8315 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 294, __pyx_L1_error)
8316 __Pyx_GOTREF(__pyx_t_20);
8317 __pyx_t_18 = PyTuple_New(2);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8318 __Pyx_GOTREF(__pyx_t_18);
8319 __Pyx_GIVEREF(__pyx_t_17);
8320 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_17);
8321 __Pyx_GIVEREF(__pyx_t_20);
8322 PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_20);
8325 __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_18);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 294, __pyx_L1_error)
8326 __Pyx_GOTREF(__pyx_t_20);
8327 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8328 __pyx_t_18 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8329 __Pyx_GOTREF(__pyx_t_18);
8332 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
8333 __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_19);
8334 if (likely(__pyx_t_17)) {
8335 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_19);
8336 __Pyx_INCREF(__pyx_t_17);
8337 __Pyx_INCREF(
function);
8338 __Pyx_DECREF_SET(__pyx_t_19,
function);
8342 #if CYTHON_FAST_PYCALL 8343 if (PyFunction_Check(__pyx_t_19)) {
8344 PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_20, __pyx_t_18};
8345 __pyx_t_23 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 294, __pyx_L1_error)
8346 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
8347 __Pyx_GOTREF(__pyx_t_23);
8348 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8349 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8352 #if CYTHON_FAST_PYCCALL 8353 if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
8354 PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_20, __pyx_t_18};
8355 __pyx_t_23 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 294, __pyx_L1_error)
8356 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
8357 __Pyx_GOTREF(__pyx_t_23);
8358 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8359 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8363 __pyx_t_24 = PyTuple_New(2+__pyx_t_22);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 294, __pyx_L1_error)
8364 __Pyx_GOTREF(__pyx_t_24);
8366 __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_17); __pyx_t_17 = NULL;
8368 __Pyx_GIVEREF(__pyx_t_20);
8369 PyTuple_SET_ITEM(__pyx_t_24, 0+__pyx_t_22, __pyx_t_20);
8370 __Pyx_GIVEREF(__pyx_t_18);
8371 PyTuple_SET_ITEM(__pyx_t_24, 1+__pyx_t_22, __pyx_t_18);
8374 __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_24, NULL);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 294, __pyx_L1_error)
8375 __Pyx_GOTREF(__pyx_t_23);
8376 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
8378 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8379 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8380 __Pyx_GOTREF(__pyx_t_19);
8381 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 294, __pyx_L1_error)
8382 __Pyx_GOTREF(__pyx_t_24);
8383 __pyx_t_18 = PyTuple_New(2);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8384 __Pyx_GOTREF(__pyx_t_18);
8385 __Pyx_GIVEREF(__pyx_t_19);
8386 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_19);
8387 __Pyx_GIVEREF(__pyx_t_24);
8388 PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_24);
8391 __pyx_t_24 = __Pyx_PyObject_GetItem(__pyx_t_23, __pyx_t_18);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 294, __pyx_L1_error)
8392 __Pyx_GOTREF(__pyx_t_24);
8393 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
8394 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8395 __pyx_t_18 = PyNumber_Multiply(__pyx_t_21, __pyx_t_24);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8396 __Pyx_GOTREF(__pyx_t_18);
8397 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8398 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
8399 __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_t_18);
if (unlikely((__pyx_t_25 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 294, __pyx_L1_error)
8400 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8401 __pyx_v_numer = __pyx_t_25;
8410 if (unlikely(__pyx_v_material_functions == Py_None)) {
8411 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8412 __PYX_ERR(0, 295, __pyx_L1_error)
8414 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 295, __pyx_L1_error)
8415 __Pyx_GOTREF(__pyx_t_24);
8416 __pyx_t_21 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_24);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8417 __Pyx_GOTREF(__pyx_t_21);
8418 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
8419 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 295, __pyx_L1_error)
8420 __Pyx_GOTREF(__pyx_t_24);
8421 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 295, __pyx_L1_error)
8422 __Pyx_GOTREF(__pyx_t_23);
8423 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8424 __Pyx_GOTREF(__pyx_t_19);
8425 __Pyx_GIVEREF(__pyx_t_24);
8426 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_24);
8427 __Pyx_GIVEREF(__pyx_t_23);
8428 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_23);
8431 __pyx_t_23 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_19);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 295, __pyx_L1_error)
8432 __Pyx_GOTREF(__pyx_t_23);
8433 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8434 __pyx_t_19 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8435 __Pyx_GOTREF(__pyx_t_19);
8438 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_21))) {
8439 __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_21);
8440 if (likely(__pyx_t_24)) {
8441 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_21);
8442 __Pyx_INCREF(__pyx_t_24);
8443 __Pyx_INCREF(
function);
8444 __Pyx_DECREF_SET(__pyx_t_21,
function);
8448 #if CYTHON_FAST_PYCALL 8449 if (PyFunction_Check(__pyx_t_21)) {
8450 PyObject *__pyx_temp[3] = {__pyx_t_24, __pyx_t_23, __pyx_t_19};
8451 __pyx_t_18 = __Pyx_PyFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
8452 __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
8453 __Pyx_GOTREF(__pyx_t_18);
8454 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
8455 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8458 #if CYTHON_FAST_PYCCALL 8459 if (__Pyx_PyFastCFunction_Check(__pyx_t_21)) {
8460 PyObject *__pyx_temp[3] = {__pyx_t_24, __pyx_t_23, __pyx_t_19};
8461 __pyx_t_18 = __Pyx_PyCFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
8462 __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
8463 __Pyx_GOTREF(__pyx_t_18);
8464 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
8465 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8469 __pyx_t_20 = PyTuple_New(2+__pyx_t_22);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 295, __pyx_L1_error)
8470 __Pyx_GOTREF(__pyx_t_20);
8472 __Pyx_GIVEREF(__pyx_t_24); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_24); __pyx_t_24 = NULL;
8474 __Pyx_GIVEREF(__pyx_t_23);
8475 PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_22, __pyx_t_23);
8476 __Pyx_GIVEREF(__pyx_t_19);
8477 PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_22, __pyx_t_19);
8480 __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_20, NULL);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
8481 __Pyx_GOTREF(__pyx_t_18);
8482 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8484 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8485 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8486 __Pyx_GOTREF(__pyx_t_21);
8487 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 295, __pyx_L1_error)
8488 __Pyx_GOTREF(__pyx_t_20);
8489 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8490 __Pyx_GOTREF(__pyx_t_19);
8491 __Pyx_GIVEREF(__pyx_t_21);
8492 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_21);
8493 __Pyx_GIVEREF(__pyx_t_20);
8494 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_20);
8497 __pyx_t_20 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_19);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 295, __pyx_L1_error)
8498 __Pyx_GOTREF(__pyx_t_20);
8499 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8500 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8501 if (unlikely(__pyx_v_material_functions == Py_None)) {
8502 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8503 __PYX_ERR(0, 295, __pyx_L1_error)
8505 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
8506 __Pyx_GOTREF(__pyx_t_18);
8507 __pyx_t_21 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8508 __Pyx_GOTREF(__pyx_t_21);
8509 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8510 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
8511 __Pyx_GOTREF(__pyx_t_18);
8512 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 295, __pyx_L1_error)
8513 __Pyx_GOTREF(__pyx_t_23);
8514 __pyx_t_24 = PyTuple_New(2);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 295, __pyx_L1_error)
8515 __Pyx_GOTREF(__pyx_t_24);
8516 __Pyx_GIVEREF(__pyx_t_18);
8517 PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_18);
8518 __Pyx_GIVEREF(__pyx_t_23);
8519 PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_23);
8522 __pyx_t_23 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_24);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 295, __pyx_L1_error)
8523 __Pyx_GOTREF(__pyx_t_23);
8524 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
8525 __pyx_t_24 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 295, __pyx_L1_error)
8526 __Pyx_GOTREF(__pyx_t_24);
8529 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_21))) {
8530 __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_21);
8531 if (likely(__pyx_t_18)) {
8532 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_21);
8533 __Pyx_INCREF(__pyx_t_18);
8534 __Pyx_INCREF(
function);
8535 __Pyx_DECREF_SET(__pyx_t_21,
function);
8539 #if CYTHON_FAST_PYCALL 8540 if (PyFunction_Check(__pyx_t_21)) {
8541 PyObject *__pyx_temp[3] = {__pyx_t_18, __pyx_t_23, __pyx_t_24};
8542 __pyx_t_19 = __Pyx_PyFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8543 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
8544 __Pyx_GOTREF(__pyx_t_19);
8545 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
8546 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
8549 #if CYTHON_FAST_PYCCALL 8550 if (__Pyx_PyFastCFunction_Check(__pyx_t_21)) {
8551 PyObject *__pyx_temp[3] = {__pyx_t_18, __pyx_t_23, __pyx_t_24};
8552 __pyx_t_19 = __Pyx_PyCFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8553 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
8554 __Pyx_GOTREF(__pyx_t_19);
8555 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
8556 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
8560 __pyx_t_17 = PyTuple_New(2+__pyx_t_22);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8561 __Pyx_GOTREF(__pyx_t_17);
8563 __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_18); __pyx_t_18 = NULL;
8565 __Pyx_GIVEREF(__pyx_t_23);
8566 PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_22, __pyx_t_23);
8567 __Pyx_GIVEREF(__pyx_t_24);
8568 PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_22, __pyx_t_24);
8571 __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_17, NULL);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8572 __Pyx_GOTREF(__pyx_t_19);
8573 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8575 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8576 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8577 __Pyx_GOTREF(__pyx_t_21);
8578 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8579 __Pyx_GOTREF(__pyx_t_17);
8580 __pyx_t_24 = PyTuple_New(2);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 295, __pyx_L1_error)
8581 __Pyx_GOTREF(__pyx_t_24);
8582 __Pyx_GIVEREF(__pyx_t_21);
8583 PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_21);
8584 __Pyx_GIVEREF(__pyx_t_17);
8585 PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_17);
8588 __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_t_19, __pyx_t_24);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8589 __Pyx_GOTREF(__pyx_t_17);
8590 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8591 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
8592 __pyx_t_24 = PyNumber_Add(__pyx_t_20, __pyx_t_17);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 295, __pyx_L1_error)
8593 __Pyx_GOTREF(__pyx_t_24);
8594 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8595 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8596 __pyx_t_17 = __Pyx_PyFloat_AddObjC(__pyx_t_24, __pyx_float_1_0eneg_20, 1.0e-20, 0, 0);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8597 __Pyx_GOTREF(__pyx_t_17);
8598 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
8599 __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_t_17);
if (unlikely((__pyx_t_25 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 295, __pyx_L1_error)
8600 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8601 __pyx_v_denom = __pyx_t_25;
8610 if (unlikely(__pyx_v_denom == 0)) {
8611 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
8612 __PYX_ERR(0, 296, __pyx_L1_error)
8614 __pyx_t_26 = __pyx_v_ebN;
8615 __pyx_t_27 = __pyx_v_k;
8616 __pyx_t_28 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
8618 if (__pyx_t_26 < 0) {
8619 __pyx_t_26 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
8620 if (unlikely(__pyx_t_26 < 0)) __pyx_t_22 = 0;
8621 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_22 = 0;
8622 if (__pyx_t_27 < 0) {
8623 __pyx_t_27 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
8624 if (unlikely(__pyx_t_27 < 0)) __pyx_t_22 = 1;
8625 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_22 = 1;
8626 if (__pyx_t_28 < 0) {
8627 __pyx_t_28 += __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape;
8628 if (unlikely(__pyx_t_28 < 0)) __pyx_t_22 = 2;
8629 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape)) __pyx_t_22 = 2;
8630 if (unlikely(__pyx_t_22 != -1)) {
8631 __Pyx_RaiseBufferIndexError(__pyx_t_22);
8632 __PYX_ERR(0, 296, __pyx_L1_error)
8634 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides, __pyx_t_28, __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides) = (__pyx_v_numer / __pyx_v_denom);
8649 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8652 __Pyx_XDECREF(__pyx_t_17);
8653 __Pyx_XDECREF(__pyx_t_18);
8654 __Pyx_XDECREF(__pyx_t_19);
8655 __Pyx_XDECREF(__pyx_t_20);
8656 __Pyx_XDECREF(__pyx_t_21);
8657 __Pyx_XDECREF(__pyx_t_23);
8658 __Pyx_XDECREF(__pyx_t_24);
8659 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
8660 __Pyx_PyThreadState_declare
8661 __Pyx_PyThreadState_assign
8662 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
8663 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
8664 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
8665 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
8666 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
8667 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
8668 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
8672 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
8673 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
8674 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
8675 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
8677 __Pyx_XGIVEREF(__pyx_r);
8678 __Pyx_RefNannyFinishContext();
8691 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8692 static char __pyx_doc_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear[] =
"\n routine for evaluating linaer interface (nodal) coefficients in NCP1 approximation for Darcy Flow\n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n assumes slight compressiblity for now\n\n TODO:\n everything\n \n ";
8693 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear = {
"RE_NCP1_evaluateElementCoefficients_Linear", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear};
8694 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8696 PyArrayObject *__pyx_v_gravity = 0;
8697 PyArrayObject *__pyx_v_rowptr = 0;
8698 PyArrayObject *__pyx_v_colind = 0;
8699 PyArrayObject *__pyx_v_KWs = 0;
8701 int __pyx_v_nElements_global;
8702 int __pyx_v_nElementBoundaries_element;
8703 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
8704 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
8705 PyArrayObject *__pyx_v_q_flin = 0;
8706 PyArrayObject *__pyx_v_q_alin = 0;
8707 PyObject *__pyx_r = 0;
8708 __Pyx_RefNannyDeclarations
8709 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_Linear (wrapper)", 0);
8711 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rho,&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_KWs,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,0};
8712 PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
8713 if (unlikely(__pyx_kwds)) {
8715 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8717 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8719 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8721 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8723 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8725 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8727 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8729 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8731 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8733 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8735 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8737 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8739 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8742 default:
goto __pyx_L5_argtuple_error;
8744 kw_args = PyDict_Size(__pyx_kwds);
8747 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rho)) != 0)) kw_args--;
8748 else goto __pyx_L5_argtuple_error;
8751 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
8753 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 1); __PYX_ERR(0, 301, __pyx_L3_error)
8757 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
8759 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 2); __PYX_ERR(0, 301, __pyx_L3_error)
8763 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
8765 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 3); __PYX_ERR(0, 301, __pyx_L3_error)
8769 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_KWs)) != 0)) kw_args--;
8771 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 4); __PYX_ERR(0, 301, __pyx_L3_error)
8775 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
8777 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 5); __PYX_ERR(0, 301, __pyx_L3_error)
8781 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
8783 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 6); __PYX_ERR(0, 301, __pyx_L3_error)
8787 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
8789 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 7); __PYX_ERR(0, 301, __pyx_L3_error)
8793 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
8795 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 8); __PYX_ERR(0, 301, __pyx_L3_error)
8799 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
8801 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 9); __PYX_ERR(0, 301, __pyx_L3_error)
8805 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
8807 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 10); __PYX_ERR(0, 301, __pyx_L3_error)
8811 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
8813 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 11); __PYX_ERR(0, 301, __pyx_L3_error)
8816 if (unlikely(kw_args > 0)) {
8817 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_evaluateElementCoefficients_Linear") < 0)) __PYX_ERR(0, 301, __pyx_L3_error)
8819 }
else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
8820 goto __pyx_L5_argtuple_error;
8822 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8823 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8824 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8825 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8826 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8827 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8828 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8829 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8830 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8831 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8832 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8833 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8835 __pyx_v_rho = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_rho == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L3_error)
8836 __pyx_v_gravity = ((PyArrayObject *)values[1]);
8837 __pyx_v_rowptr = ((PyArrayObject *)values[2]);
8838 __pyx_v_colind = ((PyArrayObject *)values[3]);
8839 __pyx_v_KWs = ((PyArrayObject *)values[4]);
8840 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L3_error)
8841 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[6]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L3_error)
8842 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[7]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L3_error)
8843 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[8]);
8844 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[9]);
8845 __pyx_v_q_flin = ((PyArrayObject *)values[10]);
8846 __pyx_v_q_alin = ((PyArrayObject *)values[11]);
8848 goto __pyx_L4_argument_unpacking_done;
8849 __pyx_L5_argtuple_error:;
8850 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 301, __pyx_L3_error)
8852 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_Linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
8853 __Pyx_RefNannyFinishContext();
8855 __pyx_L4_argument_unpacking_done:;
8856 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 302, __pyx_L1_error)
8857 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 303, __pyx_L1_error)
8858 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 304, __pyx_L1_error)
8859 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_KWs), __pyx_ptype_5numpy_ndarray, 1,
"KWs", 0))) __PYX_ERR(0, 305, __pyx_L1_error)
8860 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 310, __pyx_L1_error)
8861 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 311, __pyx_L1_error)
8862 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) __PYX_ERR(0, 312, __pyx_L1_error)
8863 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) __PYX_ERR(0, 313, __pyx_L1_error)
8864 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(__pyx_self, __pyx_v_rho, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_KWs, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementMaterialTypes, __pyx_v_q_flin, __pyx_v_q_alin);
8871 __Pyx_RefNannyFinishContext();
8875 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_KWs,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin) {
8877 int __pyx_v_eN_neighbor;
8882 int __pyx_v_matID_neig;
8883 CYTHON_UNUSED
int __pyx_v_nSpace2;
8885 PyArrayObject *__pyx_v_a_eN = 0;
8886 PyArrayObject *__pyx_v_a_neig = 0;
8887 PyArrayObject *__pyx_v_a_avg = 0;
8888 __Pyx_LocalBuf_ND __pyx_pybuffernd_KWs;
8889 __Pyx_Buffer __pyx_pybuffer_KWs;
8890 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_avg;
8891 __Pyx_Buffer __pyx_pybuffer_a_avg;
8892 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_eN;
8893 __Pyx_Buffer __pyx_pybuffer_a_eN;
8894 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_neig;
8895 __Pyx_Buffer __pyx_pybuffer_a_neig;
8896 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
8897 __Pyx_Buffer __pyx_pybuffer_colind;
8898 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
8899 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
8900 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
8901 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
8902 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
8903 __Pyx_Buffer __pyx_pybuffer_gravity;
8904 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
8905 __Pyx_Buffer __pyx_pybuffer_q_alin;
8906 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
8907 __Pyx_Buffer __pyx_pybuffer_q_flin;
8908 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
8909 __Pyx_Buffer __pyx_pybuffer_rowptr;
8910 PyObject *__pyx_r = NULL;
8911 __Pyx_RefNannyDeclarations
8912 Py_ssize_t __pyx_t_1;
8914 PyObject *__pyx_t_3 = NULL;
8915 PyObject *__pyx_t_4 = NULL;
8916 PyObject *__pyx_t_5 = NULL;
8917 PyObject *__pyx_t_6 = NULL;
8918 PyObject *__pyx_t_7 = NULL;
8919 PyArrayObject *__pyx_t_8 = NULL;
8920 PyArrayObject *__pyx_t_9 = NULL;
8921 PyArrayObject *__pyx_t_10 = NULL;
8924 Py_ssize_t __pyx_t_13;
8928 Py_ssize_t __pyx_t_17;
8929 Py_ssize_t __pyx_t_18;
8931 Py_ssize_t __pyx_t_20;
8932 Py_ssize_t __pyx_t_21;
8933 Py_ssize_t __pyx_t_22;
8936 Py_ssize_t __pyx_t_25;
8938 Py_ssize_t __pyx_t_27;
8940 Py_ssize_t __pyx_t_29;
8941 Py_ssize_t __pyx_t_30;
8942 Py_ssize_t __pyx_t_31;
8943 Py_ssize_t __pyx_t_32;
8944 Py_ssize_t __pyx_t_33;
8945 Py_ssize_t __pyx_t_34;
8946 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_35;
8947 Py_ssize_t __pyx_t_36;
8948 Py_ssize_t __pyx_t_37;
8949 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_38;
8950 Py_ssize_t __pyx_t_39;
8951 Py_ssize_t __pyx_t_40;
8952 Py_ssize_t __pyx_t_41;
8953 Py_ssize_t __pyx_t_42;
8954 Py_ssize_t __pyx_t_43;
8955 Py_ssize_t __pyx_t_44;
8956 Py_ssize_t __pyx_t_45;
8957 Py_ssize_t __pyx_t_46;
8958 Py_ssize_t __pyx_t_47;
8959 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_48;
8960 Py_ssize_t __pyx_t_49;
8961 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_50;
8962 Py_ssize_t __pyx_t_51;
8964 Py_ssize_t __pyx_t_53;
8965 Py_ssize_t __pyx_t_54;
8966 Py_ssize_t __pyx_t_55;
8967 Py_ssize_t __pyx_t_56;
8968 Py_ssize_t __pyx_t_57;
8969 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_Linear", 0);
8970 __pyx_pybuffer_a_eN.pybuffer.buf = NULL;
8971 __pyx_pybuffer_a_eN.refcount = 0;
8972 __pyx_pybuffernd_a_eN.data = NULL;
8973 __pyx_pybuffernd_a_eN.rcbuffer = &__pyx_pybuffer_a_eN;
8974 __pyx_pybuffer_a_neig.pybuffer.buf = NULL;
8975 __pyx_pybuffer_a_neig.refcount = 0;
8976 __pyx_pybuffernd_a_neig.data = NULL;
8977 __pyx_pybuffernd_a_neig.rcbuffer = &__pyx_pybuffer_a_neig;
8978 __pyx_pybuffer_a_avg.pybuffer.buf = NULL;
8979 __pyx_pybuffer_a_avg.refcount = 0;
8980 __pyx_pybuffernd_a_avg.data = NULL;
8981 __pyx_pybuffernd_a_avg.rcbuffer = &__pyx_pybuffer_a_avg;
8982 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
8983 __pyx_pybuffer_gravity.refcount = 0;
8984 __pyx_pybuffernd_gravity.data = NULL;
8985 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
8986 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
8987 __pyx_pybuffer_rowptr.refcount = 0;
8988 __pyx_pybuffernd_rowptr.data = NULL;
8989 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
8990 __pyx_pybuffer_colind.pybuffer.buf = NULL;
8991 __pyx_pybuffer_colind.refcount = 0;
8992 __pyx_pybuffernd_colind.data = NULL;
8993 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
8994 __pyx_pybuffer_KWs.pybuffer.buf = NULL;
8995 __pyx_pybuffer_KWs.refcount = 0;
8996 __pyx_pybuffernd_KWs.data = NULL;
8997 __pyx_pybuffernd_KWs.rcbuffer = &__pyx_pybuffer_KWs;
8998 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
8999 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
9000 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
9001 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
9002 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
9003 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
9004 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
9005 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
9006 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
9007 __pyx_pybuffer_q_flin.refcount = 0;
9008 __pyx_pybuffernd_q_flin.data = NULL;
9009 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
9010 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
9011 __pyx_pybuffer_q_alin.refcount = 0;
9012 __pyx_pybuffernd_q_alin.data = NULL;
9013 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
9015 __Pyx_BufFmt_StackElem __pyx_stack[1];
9016 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9018 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
9020 __Pyx_BufFmt_StackElem __pyx_stack[1];
9021 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9023 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
9025 __Pyx_BufFmt_StackElem __pyx_stack[1];
9026 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9028 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
9030 __Pyx_BufFmt_StackElem __pyx_stack[1];
9031 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer, (PyObject*)__pyx_v_KWs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9033 __pyx_pybuffernd_KWs.diminfo[0].strides = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_KWs.diminfo[0].shape = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_KWs.diminfo[1].strides = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_KWs.diminfo[1].shape = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.shape[1];
9035 __Pyx_BufFmt_StackElem __pyx_stack[1];
9036 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9038 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
9040 __Pyx_BufFmt_StackElem __pyx_stack[1];
9041 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9043 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
9045 __Pyx_BufFmt_StackElem __pyx_stack[1];
9046 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9048 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
9050 __Pyx_BufFmt_StackElem __pyx_stack[1];
9051 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9053 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
9062 __pyx_v_nSpace2 = (__pyx_v_nSpace * __pyx_v_nSpace);
9071 __pyx_t_1 = __pyx_v_nSpace;
9073 if (__pyx_t_1 < 0) {
9074 __pyx_t_1 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
9075 if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
9076 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_2 = 0;
9077 if (unlikely(__pyx_t_2 != -1)) {
9078 __Pyx_RaiseBufferIndexError(__pyx_t_2);
9079 __PYX_ERR(0, 329, __pyx_L1_error)
9081 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_rowptr.diminfo[0].strides));
9090 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
9091 __Pyx_GOTREF(__pyx_t_4);
9092 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error)
9093 __Pyx_GOTREF(__pyx_t_5);
9094 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9095 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
9096 __Pyx_GOTREF(__pyx_t_4);
9099 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
9100 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
9101 if (likely(__pyx_t_6)) {
9102 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
9103 __Pyx_INCREF(__pyx_t_6);
9104 __Pyx_INCREF(
function);
9105 __Pyx_DECREF_SET(__pyx_t_5,
function);
9109 #if CYTHON_FAST_PYCALL 9110 if (PyFunction_Check(__pyx_t_5)) {
9111 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_n_s_d};
9112 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
9113 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9114 __Pyx_GOTREF(__pyx_t_3);
9115 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9118 #if CYTHON_FAST_PYCCALL 9119 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
9120 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_n_s_d};
9121 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
9122 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9123 __Pyx_GOTREF(__pyx_t_3);
9124 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9128 __pyx_t_7 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error)
9129 __Pyx_GOTREF(__pyx_t_7);
9131 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
9133 __Pyx_GIVEREF(__pyx_t_4);
9134 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_2, __pyx_t_4);
9135 __Pyx_INCREF(__pyx_n_s_d);
9136 __Pyx_GIVEREF(__pyx_n_s_d);
9137 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_2, __pyx_n_s_d);
9139 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
9140 __Pyx_GOTREF(__pyx_t_3);
9141 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9143 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9144 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 331, __pyx_L1_error)
9145 __pyx_t_8 = ((PyArrayObject *)__pyx_t_3);
9147 __Pyx_BufFmt_StackElem __pyx_stack[1];
9148 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
9149 __pyx_v_a_eN = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf = NULL;
9150 __PYX_ERR(0, 331, __pyx_L1_error)
9151 }
else {__pyx_pybuffernd_a_eN.diminfo[0].strides = __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_eN.diminfo[0].shape = __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.shape[0];
9155 __pyx_v_a_eN = ((PyArrayObject *)__pyx_t_3);
9165 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
9166 __Pyx_GOTREF(__pyx_t_5);
9167 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error)
9168 __Pyx_GOTREF(__pyx_t_7);
9169 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9170 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
9171 __Pyx_GOTREF(__pyx_t_5);
9174 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
9175 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
9176 if (likely(__pyx_t_4)) {
9177 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
9178 __Pyx_INCREF(__pyx_t_4);
9179 __Pyx_INCREF(
function);
9180 __Pyx_DECREF_SET(__pyx_t_7,
function);
9184 #if CYTHON_FAST_PYCALL 9185 if (PyFunction_Check(__pyx_t_7)) {
9186 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
9187 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
9188 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9189 __Pyx_GOTREF(__pyx_t_3);
9190 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9193 #if CYTHON_FAST_PYCCALL 9194 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
9195 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
9196 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
9197 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9198 __Pyx_GOTREF(__pyx_t_3);
9199 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9203 __pyx_t_6 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L1_error)
9204 __Pyx_GOTREF(__pyx_t_6);
9206 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
9208 __Pyx_GIVEREF(__pyx_t_5);
9209 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_2, __pyx_t_5);
9210 __Pyx_INCREF(__pyx_n_s_d);
9211 __Pyx_GIVEREF(__pyx_n_s_d);
9212 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_2, __pyx_n_s_d);
9214 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
9215 __Pyx_GOTREF(__pyx_t_3);
9216 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9218 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9219 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 332, __pyx_L1_error)
9220 __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
9222 __Pyx_BufFmt_StackElem __pyx_stack[1];
9223 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
9224 __pyx_v_a_neig = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf = NULL;
9225 __PYX_ERR(0, 332, __pyx_L1_error)
9226 }
else {__pyx_pybuffernd_a_neig.diminfo[0].strides = __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_neig.diminfo[0].shape = __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.shape[0];
9230 __pyx_v_a_neig = ((PyArrayObject *)__pyx_t_3);
9240 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error)
9241 __Pyx_GOTREF(__pyx_t_7);
9242 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error)
9243 __Pyx_GOTREF(__pyx_t_6);
9244 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9245 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error)
9246 __Pyx_GOTREF(__pyx_t_7);
9249 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
9250 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
9251 if (likely(__pyx_t_5)) {
9252 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
9253 __Pyx_INCREF(__pyx_t_5);
9254 __Pyx_INCREF(
function);
9255 __Pyx_DECREF_SET(__pyx_t_6,
function);
9259 #if CYTHON_FAST_PYCALL 9260 if (PyFunction_Check(__pyx_t_6)) {
9261 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_n_s_d};
9262 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
9263 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9264 __Pyx_GOTREF(__pyx_t_3);
9265 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9268 #if CYTHON_FAST_PYCCALL 9269 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
9270 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_n_s_d};
9271 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
9272 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9273 __Pyx_GOTREF(__pyx_t_3);
9274 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9278 __pyx_t_4 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error)
9279 __Pyx_GOTREF(__pyx_t_4);
9281 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
9283 __Pyx_GIVEREF(__pyx_t_7);
9284 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_2, __pyx_t_7);
9285 __Pyx_INCREF(__pyx_n_s_d);
9286 __Pyx_GIVEREF(__pyx_n_s_d);
9287 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_2, __pyx_n_s_d);
9289 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
9290 __Pyx_GOTREF(__pyx_t_3);
9291 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9293 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9294 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 333, __pyx_L1_error)
9295 __pyx_t_10 = ((PyArrayObject *)__pyx_t_3);
9297 __Pyx_BufFmt_StackElem __pyx_stack[1];
9298 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
9299 __pyx_v_a_avg = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf = NULL;
9300 __PYX_ERR(0, 333, __pyx_L1_error)
9301 }
else {__pyx_pybuffernd_a_avg.diminfo[0].strides = __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_avg.diminfo[0].shape = __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.shape[0];
9305 __pyx_v_a_avg = ((PyArrayObject *)__pyx_t_3);
9315 __pyx_t_2 = __pyx_v_nElements_global;
9316 __pyx_t_11 = __pyx_t_2;
9317 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
9318 __pyx_v_eN = __pyx_t_12;
9327 __pyx_t_13 = __pyx_v_eN;
9329 if (__pyx_t_13 < 0) {
9330 __pyx_t_13 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
9331 if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
9332 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_14 = 0;
9333 if (unlikely(__pyx_t_14 != -1)) {
9334 __Pyx_RaiseBufferIndexError(__pyx_t_14);
9335 __PYX_ERR(0, 337, __pyx_L1_error)
9337 __pyx_v_matID = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
9346 __pyx_t_14 = __pyx_v_nnz;
9347 __pyx_t_15 = __pyx_t_14;
9348 for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
9349 __pyx_v_ii = __pyx_t_16;
9358 __pyx_t_17 = __pyx_v_matID;
9359 __pyx_t_18 = __pyx_v_ii;
9361 if (__pyx_t_17 < 0) {
9362 __pyx_t_17 += __pyx_pybuffernd_KWs.diminfo[0].shape;
9363 if (unlikely(__pyx_t_17 < 0)) __pyx_t_19 = 0;
9364 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_KWs.diminfo[0].shape)) __pyx_t_19 = 0;
9365 if (__pyx_t_18 < 0) {
9366 __pyx_t_18 += __pyx_pybuffernd_KWs.diminfo[1].shape;
9367 if (unlikely(__pyx_t_18 < 0)) __pyx_t_19 = 1;
9368 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_KWs.diminfo[1].shape)) __pyx_t_19 = 1;
9369 if (unlikely(__pyx_t_19 != -1)) {
9370 __Pyx_RaiseBufferIndexError(__pyx_t_19);
9371 __PYX_ERR(0, 339, __pyx_L1_error)
9373 __pyx_t_20 = __pyx_v_ii;
9375 if (__pyx_t_20 < 0) {
9376 __pyx_t_20 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9377 if (unlikely(__pyx_t_20 < 0)) __pyx_t_19 = 0;
9378 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_19 = 0;
9379 if (unlikely(__pyx_t_19 != -1)) {
9380 __Pyx_RaiseBufferIndexError(__pyx_t_19);
9381 __PYX_ERR(0, 339, __pyx_L1_error)
9383 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_a_eN.diminfo[0].strides) = (__pyx_v_rho * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_KWs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_KWs.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_KWs.diminfo[1].strides)));
9393 __pyx_t_14 = __pyx_v_nElementBoundaries_element;
9394 __pyx_t_15 = __pyx_t_14;
9395 for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
9396 __pyx_v_ebN = __pyx_t_16;
9405 __pyx_t_21 = __pyx_v_eN;
9406 __pyx_t_22 = __pyx_v_ebN;
9408 if (__pyx_t_21 < 0) {
9409 __pyx_t_21 += __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape;
9410 if (unlikely(__pyx_t_21 < 0)) __pyx_t_19 = 0;
9411 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape)) __pyx_t_19 = 0;
9412 if (__pyx_t_22 < 0) {
9413 __pyx_t_22 += __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape;
9414 if (unlikely(__pyx_t_22 < 0)) __pyx_t_19 = 1;
9415 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape)) __pyx_t_19 = 1;
9416 if (unlikely(__pyx_t_19 != -1)) {
9417 __Pyx_RaiseBufferIndexError(__pyx_t_19);
9418 __PYX_ERR(0, 341, __pyx_L1_error)
9420 __pyx_v_eN_neighbor = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides));
9429 __pyx_t_19 = __pyx_v_nnz;
9430 __pyx_t_23 = __pyx_t_19;
9431 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
9432 __pyx_v_ii = __pyx_t_24;
9441 __pyx_t_25 = __pyx_v_ii;
9443 if (__pyx_t_25 < 0) {
9444 __pyx_t_25 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9445 if (unlikely(__pyx_t_25 < 0)) __pyx_t_26 = 0;
9446 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_26 = 0;
9447 if (unlikely(__pyx_t_26 != -1)) {
9448 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9449 __PYX_ERR(0, 343, __pyx_L1_error)
9451 __pyx_t_27 = __pyx_v_ii;
9453 if (__pyx_t_27 < 0) {
9454 __pyx_t_27 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9455 if (unlikely(__pyx_t_27 < 0)) __pyx_t_26 = 0;
9456 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_26 = 0;
9457 if (unlikely(__pyx_t_26 != -1)) {
9458 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9459 __PYX_ERR(0, 343, __pyx_L1_error)
9461 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_a_neig.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_a_eN.diminfo[0].strides));
9471 __pyx_t_28 = ((__pyx_v_eN_neighbor >= 0) != 0);
9481 __pyx_t_29 = __pyx_v_eN_neighbor;
9483 if (__pyx_t_29 < 0) {
9484 __pyx_t_29 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
9485 if (unlikely(__pyx_t_29 < 0)) __pyx_t_19 = 0;
9486 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_19 = 0;
9487 if (unlikely(__pyx_t_19 != -1)) {
9488 __Pyx_RaiseBufferIndexError(__pyx_t_19);
9489 __PYX_ERR(0, 345, __pyx_L1_error)
9491 __pyx_v_matID_neig = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
9500 __pyx_t_19 = __pyx_v_nnz;
9501 __pyx_t_23 = __pyx_t_19;
9502 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
9503 __pyx_v_ii = __pyx_t_24;
9512 __pyx_t_30 = __pyx_v_matID_neig;
9513 __pyx_t_31 = __pyx_v_ii;
9515 if (__pyx_t_30 < 0) {
9516 __pyx_t_30 += __pyx_pybuffernd_KWs.diminfo[0].shape;
9517 if (unlikely(__pyx_t_30 < 0)) __pyx_t_26 = 0;
9518 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_KWs.diminfo[0].shape)) __pyx_t_26 = 0;
9519 if (__pyx_t_31 < 0) {
9520 __pyx_t_31 += __pyx_pybuffernd_KWs.diminfo[1].shape;
9521 if (unlikely(__pyx_t_31 < 0)) __pyx_t_26 = 1;
9522 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_KWs.diminfo[1].shape)) __pyx_t_26 = 1;
9523 if (unlikely(__pyx_t_26 != -1)) {
9524 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9525 __PYX_ERR(0, 347, __pyx_L1_error)
9527 __pyx_t_32 = __pyx_v_ii;
9529 if (__pyx_t_32 < 0) {
9530 __pyx_t_32 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9531 if (unlikely(__pyx_t_32 < 0)) __pyx_t_26 = 0;
9532 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_26 = 0;
9533 if (unlikely(__pyx_t_26 != -1)) {
9534 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9535 __PYX_ERR(0, 347, __pyx_L1_error)
9537 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_a_neig.diminfo[0].strides) = (__pyx_v_rho * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_KWs.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_KWs.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_KWs.diminfo[1].strides)));
9556 __pyx_t_19 = __pyx_v_nnz;
9557 __pyx_t_23 = __pyx_t_19;
9558 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
9559 __pyx_v_ii = __pyx_t_24;
9568 __pyx_t_33 = __pyx_v_ii;
9570 if (__pyx_t_33 < 0) {
9571 __pyx_t_33 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9572 if (unlikely(__pyx_t_33 < 0)) __pyx_t_26 = 0;
9573 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_26 = 0;
9574 if (unlikely(__pyx_t_26 != -1)) {
9575 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9576 __PYX_ERR(0, 349, __pyx_L1_error)
9578 __pyx_t_34 = __pyx_v_ii;
9580 if (__pyx_t_34 < 0) {
9581 __pyx_t_34 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9582 if (unlikely(__pyx_t_34 < 0)) __pyx_t_26 = 0;
9583 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_26 = 0;
9584 if (unlikely(__pyx_t_26 != -1)) {
9585 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9586 __PYX_ERR(0, 349, __pyx_L1_error)
9588 __pyx_t_35 = ((2.0 * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_a_eN.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_a_neig.diminfo[0].strides)));
9589 __pyx_t_36 = __pyx_v_ii;
9591 if (__pyx_t_36 < 0) {
9592 __pyx_t_36 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9593 if (unlikely(__pyx_t_36 < 0)) __pyx_t_26 = 0;
9594 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_26 = 0;
9595 if (unlikely(__pyx_t_26 != -1)) {
9596 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9597 __PYX_ERR(0, 349, __pyx_L1_error)
9599 __pyx_t_37 = __pyx_v_ii;
9601 if (__pyx_t_37 < 0) {
9602 __pyx_t_37 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9603 if (unlikely(__pyx_t_37 < 0)) __pyx_t_26 = 0;
9604 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_26 = 0;
9605 if (unlikely(__pyx_t_26 != -1)) {
9606 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9607 __PYX_ERR(0, 349, __pyx_L1_error)
9609 __pyx_t_38 = (((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_a_eN.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_a_neig.diminfo[0].strides))) + 1.0e-20);
9610 if (unlikely(__pyx_t_38 == 0)) {
9611 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
9612 __PYX_ERR(0, 349, __pyx_L1_error)
9614 __pyx_t_39 = __pyx_v_ii;
9616 if (__pyx_t_39 < 0) {
9617 __pyx_t_39 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
9618 if (unlikely(__pyx_t_39 < 0)) __pyx_t_26 = 0;
9619 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_26 = 0;
9620 if (unlikely(__pyx_t_26 != -1)) {
9621 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9622 __PYX_ERR(0, 349, __pyx_L1_error)
9624 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_a_avg.diminfo[0].strides) = (__pyx_t_35 / __pyx_t_38);
9633 __pyx_t_40 = __pyx_v_ii;
9635 if (__pyx_t_40 < 0) {
9636 __pyx_t_40 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
9637 if (unlikely(__pyx_t_40 < 0)) __pyx_t_26 = 0;
9638 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_26 = 0;
9639 if (unlikely(__pyx_t_26 != -1)) {
9640 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9641 __PYX_ERR(0, 350, __pyx_L1_error)
9643 __pyx_t_41 = __pyx_v_eN;
9644 __pyx_t_42 = __pyx_v_ebN;
9645 __pyx_t_43 = __pyx_v_ii;
9647 if (__pyx_t_41 < 0) {
9648 __pyx_t_41 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
9649 if (unlikely(__pyx_t_41 < 0)) __pyx_t_26 = 0;
9650 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_26 = 0;
9651 if (__pyx_t_42 < 0) {
9652 __pyx_t_42 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
9653 if (unlikely(__pyx_t_42 < 0)) __pyx_t_26 = 1;
9654 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_26 = 1;
9655 if (__pyx_t_43 < 0) {
9656 __pyx_t_43 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
9657 if (unlikely(__pyx_t_43 < 0)) __pyx_t_26 = 2;
9658 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_26 = 2;
9659 if (unlikely(__pyx_t_26 != -1)) {
9660 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9661 __PYX_ERR(0, 350, __pyx_L1_error)
9663 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_43, __pyx_pybuffernd_q_alin.diminfo[2].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_a_avg.diminfo[0].strides));
9673 __pyx_t_19 = __pyx_v_nSpace;
9674 __pyx_t_23 = __pyx_t_19;
9675 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
9676 __pyx_v_I = __pyx_t_24;
9685 __pyx_t_44 = __pyx_v_eN;
9686 __pyx_t_45 = __pyx_v_ebN;
9687 __pyx_t_46 = __pyx_v_I;
9689 if (__pyx_t_44 < 0) {
9690 __pyx_t_44 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
9691 if (unlikely(__pyx_t_44 < 0)) __pyx_t_26 = 0;
9692 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_26 = 0;
9693 if (__pyx_t_45 < 0) {
9694 __pyx_t_45 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
9695 if (unlikely(__pyx_t_45 < 0)) __pyx_t_26 = 1;
9696 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_26 = 1;
9697 if (__pyx_t_46 < 0) {
9698 __pyx_t_46 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
9699 if (unlikely(__pyx_t_46 < 0)) __pyx_t_26 = 2;
9700 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_26 = 2;
9701 if (unlikely(__pyx_t_26 != -1)) {
9702 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9703 __PYX_ERR(0, 352, __pyx_L1_error)
9705 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_46, __pyx_pybuffernd_q_flin.diminfo[2].strides) = 0.0;
9714 __pyx_t_47 = (__pyx_v_I + 1);
9716 if (__pyx_t_47 < 0) {
9717 __pyx_t_47 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
9718 if (unlikely(__pyx_t_47 < 0)) __pyx_t_26 = 0;
9719 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_26 = 0;
9720 if (unlikely(__pyx_t_26 != -1)) {
9721 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9722 __PYX_ERR(0, 353, __pyx_L1_error)
9724 __pyx_t_48 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_rowptr.diminfo[0].strides));
9725 __pyx_t_49 = __pyx_v_I;
9727 if (__pyx_t_49 < 0) {
9728 __pyx_t_49 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
9729 if (unlikely(__pyx_t_49 < 0)) __pyx_t_26 = 0;
9730 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_26 = 0;
9731 if (unlikely(__pyx_t_26 != -1)) {
9732 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9733 __PYX_ERR(0, 353, __pyx_L1_error)
9735 __pyx_t_50 = __pyx_t_48;
9736 for (__pyx_t_26 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_26 < __pyx_t_50; __pyx_t_26+=1) {
9737 __pyx_v_ii = __pyx_t_26;
9746 __pyx_t_51 = __pyx_v_ii;
9748 if (__pyx_t_51 < 0) {
9749 __pyx_t_51 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
9750 if (unlikely(__pyx_t_51 < 0)) __pyx_t_52 = 0;
9751 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_52 = 0;
9752 if (unlikely(__pyx_t_52 != -1)) {
9753 __Pyx_RaiseBufferIndexError(__pyx_t_52);
9754 __PYX_ERR(0, 354, __pyx_L1_error)
9756 __pyx_t_53 = __pyx_v_ii;
9758 if (__pyx_t_53 < 0) {
9759 __pyx_t_53 += __pyx_pybuffernd_colind.diminfo[0].shape;
9760 if (unlikely(__pyx_t_53 < 0)) __pyx_t_52 = 0;
9761 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_52 = 0;
9762 if (unlikely(__pyx_t_52 != -1)) {
9763 __Pyx_RaiseBufferIndexError(__pyx_t_52);
9764 __PYX_ERR(0, 354, __pyx_L1_error)
9766 __pyx_t_54 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_colind.diminfo[0].strides));
9768 if (__pyx_t_54 < 0) {
9769 __pyx_t_54 += __pyx_pybuffernd_gravity.diminfo[0].shape;
9770 if (unlikely(__pyx_t_54 < 0)) __pyx_t_52 = 0;
9771 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_gravity.diminfo[0].shape)) __pyx_t_52 = 0;
9772 if (unlikely(__pyx_t_52 != -1)) {
9773 __Pyx_RaiseBufferIndexError(__pyx_t_52);
9774 __PYX_ERR(0, 354, __pyx_L1_error)
9776 __pyx_t_55 = __pyx_v_eN;
9777 __pyx_t_56 = __pyx_v_ebN;
9778 __pyx_t_57 = __pyx_v_I;
9780 if (__pyx_t_55 < 0) {
9781 __pyx_t_55 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
9782 if (unlikely(__pyx_t_55 < 0)) __pyx_t_52 = 0;
9783 }
else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_52 = 0;
9784 if (__pyx_t_56 < 0) {
9785 __pyx_t_56 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
9786 if (unlikely(__pyx_t_56 < 0)) __pyx_t_52 = 1;
9787 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_52 = 1;
9788 if (__pyx_t_57 < 0) {
9789 __pyx_t_57 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
9790 if (unlikely(__pyx_t_57 < 0)) __pyx_t_52 = 2;
9791 }
else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_52 = 2;
9792 if (unlikely(__pyx_t_52 != -1)) {
9793 __Pyx_RaiseBufferIndexError(__pyx_t_52);
9794 __PYX_ERR(0, 354, __pyx_L1_error)
9796 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_57, __pyx_pybuffernd_q_flin.diminfo[2].strides) += ((__pyx_v_rho * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_a_avg.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_gravity.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_gravity.diminfo[0].strides)));
9811 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9814 __Pyx_XDECREF(__pyx_t_3);
9815 __Pyx_XDECREF(__pyx_t_4);
9816 __Pyx_XDECREF(__pyx_t_5);
9817 __Pyx_XDECREF(__pyx_t_6);
9818 __Pyx_XDECREF(__pyx_t_7);
9819 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
9820 __Pyx_PyThreadState_declare
9821 __Pyx_PyThreadState_assign
9822 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
9823 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer);
9824 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer);
9825 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer);
9826 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer);
9827 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
9828 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
9829 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
9830 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
9831 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
9832 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
9833 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
9834 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
9835 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_Linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
9839 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer);
9840 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer);
9841 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer);
9842 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer);
9843 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
9844 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
9845 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
9846 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
9847 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
9848 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
9849 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
9851 __Pyx_XDECREF((PyObject *)__pyx_v_a_eN);
9852 __Pyx_XDECREF((PyObject *)__pyx_v_a_neig);
9853 __Pyx_XDECREF((PyObject *)__pyx_v_a_avg);
9854 __Pyx_XGIVEREF(__pyx_r);
9855 __Pyx_RefNannyFinishContext();
9868 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9869 static char __pyx_doc_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM[] =
"\n routine for evaluating nodal coefficients in NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n assumes slight compressiblity for now\n\n TODO:\n everything\n \n ";
9870 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM = {
"RE_NCP1_evaluateElementCoefficients_VGM", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM};
9871 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9873 double __pyx_v_beta;
9874 PyArrayObject *__pyx_v_gravity = 0;
9875 PyArrayObject *__pyx_v_alpha = 0;
9876 PyArrayObject *__pyx_v_n = 0;
9877 PyArrayObject *__pyx_v_thetaR = 0;
9878 PyArrayObject *__pyx_v_thetaSR = 0;
9880 int __pyx_v_nElements_global;
9881 int __pyx_v_nElementBoundaries_element;
9882 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
9883 PyArrayObject *__pyx_v_elementBarycentersArray = 0;
9884 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
9885 int __pyx_v_nDOF_trial_element;
9886 PyArrayObject *__pyx_v_u_l2g = 0;
9887 PyArrayObject *__pyx_v_u_dof = 0;
9888 CYTHON_UNUSED PyArrayObject *__pyx_v_q_x = 0;
9889 PyArrayObject *__pyx_v_q_u = 0;
9890 PyArrayObject *__pyx_v_q_mass = 0;
9891 PyArrayObject *__pyx_v_q_dmass = 0;
9892 PyArrayObject *__pyx_v_q_r = 0;
9893 PyArrayObject *__pyx_v_q_kr = 0;
9894 PyArrayObject *__pyx_v_q_dkr = 0;
9895 PyArrayObject *__pyx_v_q_kr_up = 0;
9896 PyObject *__pyx_r = 0;
9897 __Pyx_RefNannyDeclarations
9898 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_VGM (wrapper)", 0);
9900 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rho,&__pyx_n_s_beta,&__pyx_n_s_gravity,&__pyx_n_s_alpha,&__pyx_n_s_n,&__pyx_n_s_thetaR,&__pyx_n_s_thetaSR,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_nDOF_trial_element,&__pyx_n_s_u_l2g,&__pyx_n_s_u_dof,&__pyx_n_s_q_x,&__pyx_n_s_q_u,&__pyx_n_s_q_mass,&__pyx_n_s_q_dmass,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_dkr,&__pyx_n_s_q_kr_up,0};
9901 PyObject* values[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
9902 if (unlikely(__pyx_kwds)) {
9904 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9906 case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
9908 case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
9910 case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
9912 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
9914 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
9916 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
9918 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
9920 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
9922 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
9924 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
9926 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
9928 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
9930 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
9932 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
9934 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
9936 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
9938 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
9940 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
9942 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
9944 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9946 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9948 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9950 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9952 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9955 default:
goto __pyx_L5_argtuple_error;
9957 kw_args = PyDict_Size(__pyx_kwds);
9960 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rho)) != 0)) kw_args--;
9961 else goto __pyx_L5_argtuple_error;
9964 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
9966 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 1); __PYX_ERR(0, 359, __pyx_L3_error)
9970 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
9972 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 2); __PYX_ERR(0, 359, __pyx_L3_error)
9976 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
9978 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 3); __PYX_ERR(0, 359, __pyx_L3_error)
9982 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
9984 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 4); __PYX_ERR(0, 359, __pyx_L3_error)
9988 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thetaR)) != 0)) kw_args--;
9990 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 5); __PYX_ERR(0, 359, __pyx_L3_error)
9994 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thetaSR)) != 0)) kw_args--;
9996 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 6); __PYX_ERR(0, 359, __pyx_L3_error)
10000 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
10002 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 7); __PYX_ERR(0, 359, __pyx_L3_error)
10004 CYTHON_FALLTHROUGH;
10006 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
10008 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 8); __PYX_ERR(0, 359, __pyx_L3_error)
10010 CYTHON_FALLTHROUGH;
10012 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
10014 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 9); __PYX_ERR(0, 359, __pyx_L3_error)
10016 CYTHON_FALLTHROUGH;
10018 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
10020 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 10); __PYX_ERR(0, 359, __pyx_L3_error)
10022 CYTHON_FALLTHROUGH;
10024 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
10026 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 11); __PYX_ERR(0, 359, __pyx_L3_error)
10028 CYTHON_FALLTHROUGH;
10030 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
10032 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 12); __PYX_ERR(0, 359, __pyx_L3_error)
10034 CYTHON_FALLTHROUGH;
10036 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_trial_element)) != 0)) kw_args--;
10038 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 13); __PYX_ERR(0, 359, __pyx_L3_error)
10040 CYTHON_FALLTHROUGH;
10042 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_u_l2g)) != 0)) kw_args--;
10044 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 14); __PYX_ERR(0, 359, __pyx_L3_error)
10046 CYTHON_FALLTHROUGH;
10048 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_u_dof)) != 0)) kw_args--;
10050 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 15); __PYX_ERR(0, 359, __pyx_L3_error)
10052 CYTHON_FALLTHROUGH;
10054 if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_x)) != 0)) kw_args--;
10056 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 16); __PYX_ERR(0, 359, __pyx_L3_error)
10058 CYTHON_FALLTHROUGH;
10060 if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
10062 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 17); __PYX_ERR(0, 359, __pyx_L3_error)
10064 CYTHON_FALLTHROUGH;
10066 if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_mass)) != 0)) kw_args--;
10068 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 18); __PYX_ERR(0, 359, __pyx_L3_error)
10070 CYTHON_FALLTHROUGH;
10072 if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dmass)) != 0)) kw_args--;
10074 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 19); __PYX_ERR(0, 359, __pyx_L3_error)
10076 CYTHON_FALLTHROUGH;
10078 if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
10080 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 20); __PYX_ERR(0, 359, __pyx_L3_error)
10082 CYTHON_FALLTHROUGH;
10084 if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
10086 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 21); __PYX_ERR(0, 359, __pyx_L3_error)
10088 CYTHON_FALLTHROUGH;
10090 if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dkr)) != 0)) kw_args--;
10092 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 22); __PYX_ERR(0, 359, __pyx_L3_error)
10094 CYTHON_FALLTHROUGH;
10096 if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
10098 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 23); __PYX_ERR(0, 359, __pyx_L3_error)
10101 if (unlikely(kw_args > 0)) {
10102 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_evaluateElementCoefficients_VGM") < 0)) __PYX_ERR(0, 359, __pyx_L3_error)
10104 }
else if (PyTuple_GET_SIZE(__pyx_args) != 24) {
10105 goto __pyx_L5_argtuple_error;
10107 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10108 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10109 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10110 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10111 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10112 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
10113 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
10114 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
10115 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
10116 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
10117 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
10118 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
10119 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
10120 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
10121 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
10122 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
10123 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
10124 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
10125 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
10126 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
10127 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
10128 values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
10129 values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
10130 values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
10132 __pyx_v_rho = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_rho == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L3_error)
10133 __pyx_v_beta = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_beta == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error)
10134 __pyx_v_gravity = ((PyArrayObject *)values[2]);
10135 __pyx_v_alpha = ((PyArrayObject *)values[3]);
10136 __pyx_v_n = ((PyArrayObject *)values[4]);
10137 __pyx_v_thetaR = ((PyArrayObject *)values[5]);
10138 __pyx_v_thetaSR = ((PyArrayObject *)values[6]);
10139 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[7]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L3_error)
10140 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error)
10141 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[9]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L3_error)
10142 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[10]);
10143 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[11]);
10144 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[12]);
10145 __pyx_v_nDOF_trial_element = __Pyx_PyInt_As_int(values[13]);
if (unlikely((__pyx_v_nDOF_trial_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 374, __pyx_L3_error)
10146 __pyx_v_u_l2g = ((PyArrayObject *)values[14]);
10147 __pyx_v_u_dof = ((PyArrayObject *)values[15]);
10148 __pyx_v_q_x = ((PyArrayObject *)values[16]);
10149 __pyx_v_q_u = ((PyArrayObject *)values[17]);
10150 __pyx_v_q_mass = ((PyArrayObject *)values[18]);
10151 __pyx_v_q_dmass = ((PyArrayObject *)values[19]);
10152 __pyx_v_q_r = ((PyArrayObject *)values[20]);
10153 __pyx_v_q_kr = ((PyArrayObject *)values[21]);
10154 __pyx_v_q_dkr = ((PyArrayObject *)values[22]);
10155 __pyx_v_q_kr_up = ((PyArrayObject *)values[23]);
10157 goto __pyx_L4_argument_unpacking_done;
10158 __pyx_L5_argtuple_error:;
10159 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 359, __pyx_L3_error)
10161 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_VGM", __pyx_clineno, __pyx_lineno, __pyx_filename);
10162 __Pyx_RefNannyFinishContext();
10164 __pyx_L4_argument_unpacking_done:;
10165 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 361, __pyx_L1_error)
10166 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alpha), __pyx_ptype_5numpy_ndarray, 1,
"alpha", 0))) __PYX_ERR(0, 362, __pyx_L1_error)
10167 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), __pyx_ptype_5numpy_ndarray, 1,
"n", 0))) __PYX_ERR(0, 363, __pyx_L1_error)
10168 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_thetaR), __pyx_ptype_5numpy_ndarray, 1,
"thetaR", 0))) __PYX_ERR(0, 364, __pyx_L1_error)
10169 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_thetaSR), __pyx_ptype_5numpy_ndarray, 1,
"thetaSR", 0))) __PYX_ERR(0, 365, __pyx_L1_error)
10170 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 370, __pyx_L1_error)
10171 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 371, __pyx_L1_error)
10172 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 372, __pyx_L1_error)
10173 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u_l2g), __pyx_ptype_5numpy_ndarray, 1,
"u_l2g", 0))) __PYX_ERR(0, 375, __pyx_L1_error)
10174 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u_dof), __pyx_ptype_5numpy_ndarray, 1,
"u_dof", 0))) __PYX_ERR(0, 376, __pyx_L1_error)
10175 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_x), __pyx_ptype_5numpy_ndarray, 1,
"q_x", 0))) __PYX_ERR(0, 378, __pyx_L1_error)
10176 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 379, __pyx_L1_error)
10177 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mass), __pyx_ptype_5numpy_ndarray, 1,
"q_mass", 0))) __PYX_ERR(0, 380, __pyx_L1_error)
10178 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dmass), __pyx_ptype_5numpy_ndarray, 1,
"q_dmass", 0))) __PYX_ERR(0, 381, __pyx_L1_error)
10179 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) __PYX_ERR(0, 382, __pyx_L1_error)
10180 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) __PYX_ERR(0, 383, __pyx_L1_error)
10181 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dkr), __pyx_ptype_5numpy_ndarray, 1,
"q_dkr", 0))) __PYX_ERR(0, 384, __pyx_L1_error)
10182 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) __PYX_ERR(0, 385, __pyx_L1_error)
10183 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(__pyx_self, __pyx_v_rho, __pyx_v_beta, __pyx_v_gravity, __pyx_v_alpha, __pyx_v_n, __pyx_v_thetaR, __pyx_v_thetaSR, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_elementMaterialTypes, __pyx_v_nDOF_trial_element, __pyx_v_u_l2g, __pyx_v_u_dof, __pyx_v_q_x, __pyx_v_q_u, __pyx_v_q_mass, __pyx_v_q_dmass, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_dkr, __pyx_v_q_kr_up);
10190 __Pyx_RefNannyFinishContext();
10194 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho,
double __pyx_v_beta, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_alpha, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_thetaR, PyArrayObject *__pyx_v_thetaSR,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementMaterialTypes,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_u_l2g, PyArrayObject *__pyx_v_u_dof, CYTHON_UNUSED PyArrayObject *__pyx_v_q_x, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_mass, PyArrayObject *__pyx_v_q_dmass, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up) {
10195 PyObject *__pyx_v_q = NULL;
10196 double __pyx_v_psiC;
10197 double __pyx_v_pcBar;
10198 double __pyx_v_pcBar_n;
10199 double __pyx_v_pcBar_nM1;
10200 double __pyx_v_pcBar_nM2;
10201 double __pyx_v_onePlus_pcBar_n;
10202 double __pyx_v_sBar;
10203 double __pyx_v_sqrt_sBar;
10204 double __pyx_v_DsBar_DpsiC;
10205 double __pyx_v_thetaW;
10206 double __pyx_v_DthetaW_DpsiC;
10207 double __pyx_v_vBar;
10208 double __pyx_v_vBar2;
10209 double __pyx_v_DvBar_DpsiC;
10210 double __pyx_v_KWr;
10211 double __pyx_v_DKWr_DpsiC;
10212 CYTHON_UNUSED
double __pyx_v_rho2;
10213 double __pyx_v_thetaS;
10214 double __pyx_v_rhom;
10215 double __pyx_v_drhom;
10217 double __pyx_v_u_j;
10218 double __pyx_v_u_eN;
10219 double __pyx_v_u_neig;
10220 double __pyx_v_kr_eN;
10221 double __pyx_v_kr_neig;
10222 double __pyx_v_phi_eN;
10223 double __pyx_v_phi_neig;
10225 int __pyx_v_eN_neighbor;
10229 double __pyx_v_nAvgWeight;
10230 __Pyx_LocalBuf_ND __pyx_pybuffernd_alpha;
10231 __Pyx_Buffer __pyx_pybuffer_alpha;
10232 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
10233 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
10234 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
10235 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
10236 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
10237 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
10238 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
10239 __Pyx_Buffer __pyx_pybuffer_gravity;
10240 __Pyx_LocalBuf_ND __pyx_pybuffernd_n;
10241 __Pyx_Buffer __pyx_pybuffer_n;
10242 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dkr;
10243 __Pyx_Buffer __pyx_pybuffer_q_dkr;
10244 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dmass;
10245 __Pyx_Buffer __pyx_pybuffer_q_dmass;
10246 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
10247 __Pyx_Buffer __pyx_pybuffer_q_kr;
10248 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
10249 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
10250 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mass;
10251 __Pyx_Buffer __pyx_pybuffer_q_mass;
10252 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
10253 __Pyx_Buffer __pyx_pybuffer_q_r;
10254 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
10255 __Pyx_Buffer __pyx_pybuffer_q_u;
10256 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_x;
10257 __Pyx_Buffer __pyx_pybuffer_q_x;
10258 __Pyx_LocalBuf_ND __pyx_pybuffernd_thetaR;
10259 __Pyx_Buffer __pyx_pybuffer_thetaR;
10260 __Pyx_LocalBuf_ND __pyx_pybuffernd_thetaSR;
10261 __Pyx_Buffer __pyx_pybuffer_thetaSR;
10262 __Pyx_LocalBuf_ND __pyx_pybuffernd_u_dof;
10263 __Pyx_Buffer __pyx_pybuffer_u_dof;
10264 __Pyx_LocalBuf_ND __pyx_pybuffernd_u_l2g;
10265 __Pyx_Buffer __pyx_pybuffer_u_l2g;
10266 PyObject *__pyx_r = NULL;
10267 __Pyx_RefNannyDeclarations
10268 PyObject *__pyx_t_1 = NULL;
10269 PyObject *__pyx_t_2 = NULL;
10270 Py_ssize_t __pyx_t_3;
10271 PyObject *__pyx_t_4 = NULL;
10272 PyObject *__pyx_t_5 = NULL;
10278 Py_ssize_t __pyx_t_11;
10282 Py_ssize_t __pyx_t_15;
10283 Py_ssize_t __pyx_t_16;
10285 Py_ssize_t __pyx_t_18;
10286 Py_ssize_t __pyx_t_19;
10287 Py_ssize_t __pyx_t_20;
10288 Py_ssize_t __pyx_t_21;
10289 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_22;
10290 Py_ssize_t __pyx_t_23;
10291 Py_ssize_t __pyx_t_24;
10292 Py_ssize_t __pyx_t_25;
10293 Py_ssize_t __pyx_t_26;
10294 Py_ssize_t __pyx_t_27;
10295 Py_ssize_t __pyx_t_28;
10296 Py_ssize_t __pyx_t_29;
10297 Py_ssize_t __pyx_t_30;
10298 Py_ssize_t __pyx_t_31;
10299 Py_ssize_t __pyx_t_32;
10300 Py_ssize_t __pyx_t_33;
10301 Py_ssize_t __pyx_t_34;
10302 Py_ssize_t __pyx_t_35;
10303 Py_ssize_t __pyx_t_36;
10304 Py_ssize_t __pyx_t_37;
10305 Py_ssize_t __pyx_t_38;
10306 Py_ssize_t __pyx_t_39;
10307 Py_ssize_t __pyx_t_40;
10308 Py_ssize_t __pyx_t_41;
10309 PyObject *__pyx_t_42 = NULL;
10310 PyObject *__pyx_t_43 = NULL;
10311 Py_ssize_t __pyx_t_44;
10312 Py_ssize_t __pyx_t_45;
10313 Py_ssize_t __pyx_t_46;
10314 Py_ssize_t __pyx_t_47;
10315 Py_ssize_t __pyx_t_48;
10316 Py_ssize_t __pyx_t_49;
10317 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_VGM", 0);
10318 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
10319 __pyx_pybuffer_gravity.refcount = 0;
10320 __pyx_pybuffernd_gravity.data = NULL;
10321 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
10322 __pyx_pybuffer_alpha.pybuffer.buf = NULL;
10323 __pyx_pybuffer_alpha.refcount = 0;
10324 __pyx_pybuffernd_alpha.data = NULL;
10325 __pyx_pybuffernd_alpha.rcbuffer = &__pyx_pybuffer_alpha;
10326 __pyx_pybuffer_n.pybuffer.buf = NULL;
10327 __pyx_pybuffer_n.refcount = 0;
10328 __pyx_pybuffernd_n.data = NULL;
10329 __pyx_pybuffernd_n.rcbuffer = &__pyx_pybuffer_n;
10330 __pyx_pybuffer_thetaR.pybuffer.buf = NULL;
10331 __pyx_pybuffer_thetaR.refcount = 0;
10332 __pyx_pybuffernd_thetaR.data = NULL;
10333 __pyx_pybuffernd_thetaR.rcbuffer = &__pyx_pybuffer_thetaR;
10334 __pyx_pybuffer_thetaSR.pybuffer.buf = NULL;
10335 __pyx_pybuffer_thetaSR.refcount = 0;
10336 __pyx_pybuffernd_thetaSR.data = NULL;
10337 __pyx_pybuffernd_thetaSR.rcbuffer = &__pyx_pybuffer_thetaSR;
10338 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
10339 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
10340 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
10341 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
10342 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
10343 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
10344 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
10345 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
10346 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
10347 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
10348 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
10349 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
10350 __pyx_pybuffer_u_l2g.pybuffer.buf = NULL;
10351 __pyx_pybuffer_u_l2g.refcount = 0;
10352 __pyx_pybuffernd_u_l2g.data = NULL;
10353 __pyx_pybuffernd_u_l2g.rcbuffer = &__pyx_pybuffer_u_l2g;
10354 __pyx_pybuffer_u_dof.pybuffer.buf = NULL;
10355 __pyx_pybuffer_u_dof.refcount = 0;
10356 __pyx_pybuffernd_u_dof.data = NULL;
10357 __pyx_pybuffernd_u_dof.rcbuffer = &__pyx_pybuffer_u_dof;
10358 __pyx_pybuffer_q_x.pybuffer.buf = NULL;
10359 __pyx_pybuffer_q_x.refcount = 0;
10360 __pyx_pybuffernd_q_x.data = NULL;
10361 __pyx_pybuffernd_q_x.rcbuffer = &__pyx_pybuffer_q_x;
10362 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
10363 __pyx_pybuffer_q_u.refcount = 0;
10364 __pyx_pybuffernd_q_u.data = NULL;
10365 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
10366 __pyx_pybuffer_q_mass.pybuffer.buf = NULL;
10367 __pyx_pybuffer_q_mass.refcount = 0;
10368 __pyx_pybuffernd_q_mass.data = NULL;
10369 __pyx_pybuffernd_q_mass.rcbuffer = &__pyx_pybuffer_q_mass;
10370 __pyx_pybuffer_q_dmass.pybuffer.buf = NULL;
10371 __pyx_pybuffer_q_dmass.refcount = 0;
10372 __pyx_pybuffernd_q_dmass.data = NULL;
10373 __pyx_pybuffernd_q_dmass.rcbuffer = &__pyx_pybuffer_q_dmass;
10374 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
10375 __pyx_pybuffer_q_r.refcount = 0;
10376 __pyx_pybuffernd_q_r.data = NULL;
10377 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
10378 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
10379 __pyx_pybuffer_q_kr.refcount = 0;
10380 __pyx_pybuffernd_q_kr.data = NULL;
10381 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
10382 __pyx_pybuffer_q_dkr.pybuffer.buf = NULL;
10383 __pyx_pybuffer_q_dkr.refcount = 0;
10384 __pyx_pybuffernd_q_dkr.data = NULL;
10385 __pyx_pybuffernd_q_dkr.rcbuffer = &__pyx_pybuffer_q_dkr;
10386 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
10387 __pyx_pybuffer_q_kr_up.refcount = 0;
10388 __pyx_pybuffernd_q_kr_up.data = NULL;
10389 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
10391 __Pyx_BufFmt_StackElem __pyx_stack[1];
10392 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10394 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
10396 __Pyx_BufFmt_StackElem __pyx_stack[1];
10397 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer, (PyObject*)__pyx_v_alpha, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10399 __pyx_pybuffernd_alpha.diminfo[0].strides = __pyx_pybuffernd_alpha.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_alpha.diminfo[0].shape = __pyx_pybuffernd_alpha.rcbuffer->pybuffer.shape[0];
10401 __Pyx_BufFmt_StackElem __pyx_stack[1];
10402 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n.rcbuffer->pybuffer, (PyObject*)__pyx_v_n, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10404 __pyx_pybuffernd_n.diminfo[0].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n.diminfo[0].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[0];
10406 __Pyx_BufFmt_StackElem __pyx_stack[1];
10407 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer, (PyObject*)__pyx_v_thetaR, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10409 __pyx_pybuffernd_thetaR.diminfo[0].strides = __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_thetaR.diminfo[0].shape = __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.shape[0];
10411 __Pyx_BufFmt_StackElem __pyx_stack[1];
10412 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer, (PyObject*)__pyx_v_thetaSR, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10414 __pyx_pybuffernd_thetaSR.diminfo[0].strides = __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_thetaSR.diminfo[0].shape = __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.shape[0];
10416 __Pyx_BufFmt_StackElem __pyx_stack[1];
10417 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10419 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
10421 __Pyx_BufFmt_StackElem __pyx_stack[1];
10422 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10424 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
10426 __Pyx_BufFmt_StackElem __pyx_stack[1];
10427 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10429 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
10431 __Pyx_BufFmt_StackElem __pyx_stack[1];
10432 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer, (PyObject*)__pyx_v_u_l2g, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10434 __pyx_pybuffernd_u_l2g.diminfo[0].strides = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u_l2g.diminfo[0].shape = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_u_l2g.diminfo[1].strides = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_u_l2g.diminfo[1].shape = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.shape[1];
10436 __Pyx_BufFmt_StackElem __pyx_stack[1];
10437 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer, (PyObject*)__pyx_v_u_dof, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10439 __pyx_pybuffernd_u_dof.diminfo[0].strides = __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u_dof.diminfo[0].shape = __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.shape[0];
10441 __Pyx_BufFmt_StackElem __pyx_stack[1];
10442 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10444 __pyx_pybuffernd_q_x.diminfo[0].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_x.diminfo[0].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_x.diminfo[1].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_x.diminfo[1].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_x.diminfo[2].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_x.diminfo[2].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[2];
10446 __Pyx_BufFmt_StackElem __pyx_stack[1];
10447 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10449 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
10451 __Pyx_BufFmt_StackElem __pyx_stack[1];
10452 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mass, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10454 __pyx_pybuffernd_q_mass.diminfo[0].strides = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mass.diminfo[0].shape = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mass.diminfo[1].strides = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mass.diminfo[1].shape = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.shape[1];
10456 __Pyx_BufFmt_StackElem __pyx_stack[1];
10457 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dmass, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10459 __pyx_pybuffernd_q_dmass.diminfo[0].strides = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dmass.diminfo[0].shape = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dmass.diminfo[1].strides = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dmass.diminfo[1].shape = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.shape[1];
10461 __Pyx_BufFmt_StackElem __pyx_stack[1];
10462 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10464 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
10466 __Pyx_BufFmt_StackElem __pyx_stack[1];
10467 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10469 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
10471 __Pyx_BufFmt_StackElem __pyx_stack[1];
10472 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dkr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10474 __pyx_pybuffernd_q_dkr.diminfo[0].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dkr.diminfo[0].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dkr.diminfo[1].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dkr.diminfo[1].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[1];
10476 __Pyx_BufFmt_StackElem __pyx_stack[1];
10477 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10479 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
10488 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
10489 __Pyx_GOTREF(__pyx_t_1);
10490 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
10491 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
10492 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
10493 __Pyx_INCREF(((PyObject *)__pyx_v_q_mass));
10494 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mass));
10495 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_mass));
10496 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
10497 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
10498 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_r));
10499 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
10500 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
10501 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_kr));
10502 __Pyx_INCREF(((PyObject *)__pyx_v_q_dkr));
10503 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_dkr));
10504 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_dkr));
10505 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10506 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10508 if (__pyx_t_3 >= 5)
break;
10509 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 10510 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error)
10512 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
10513 __Pyx_GOTREF(__pyx_t_1);
10515 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
10525 #ifndef CYTHON_WITHOUT_ASSERTIONS 10526 if (unlikely(!Py_OptimizeFlag)) {
10527 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
10528 __Pyx_GOTREF(__pyx_t_1);
10529 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
10530 __Pyx_GOTREF(__pyx_t_4);
10531 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10532 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
10533 __Pyx_GOTREF(__pyx_t_1);
10534 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L1_error)
10535 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10536 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10537 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 400, __pyx_L1_error)
10538 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10539 if (unlikely(!__pyx_t_6)) {
10540 PyErr_SetNone(PyExc_AssertionError);
10541 __PYX_ERR(0, 400, __pyx_L1_error)
10554 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10563 #ifndef CYTHON_WITHOUT_ASSERTIONS 10564 if (unlikely(!Py_OptimizeFlag)) {
10565 if (unlikely(!((__pyx_v_nDOF_trial_element == (__pyx_v_nSpace + 1)) != 0))) {
10566 PyErr_SetNone(PyExc_AssertionError);
10567 __PYX_ERR(0, 401, __pyx_L1_error)
10579 __pyx_v_rho2 = (__pyx_v_rho * __pyx_v_rho);
10588 __pyx_t_7 = (__pyx_v_nSpace + 1.);
10589 if (unlikely(__pyx_t_7 == 0)) {
10590 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10591 __PYX_ERR(0, 409, __pyx_L1_error)
10593 __pyx_v_nAvgWeight = (1.0 / __pyx_t_7);
10602 __pyx_t_8 = __pyx_v_nElements_global;
10603 __pyx_t_9 = __pyx_t_8;
10604 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
10605 __pyx_v_eN = __pyx_t_10;
10614 __pyx_t_11 = __pyx_v_eN;
10616 if (__pyx_t_11 < 0) {
10617 __pyx_t_11 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
10618 if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
10619 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_12 = 0;
10620 if (unlikely(__pyx_t_12 != -1)) {
10621 __Pyx_RaiseBufferIndexError(__pyx_t_12);
10622 __PYX_ERR(0, 413, __pyx_L1_error)
10624 __pyx_v_matID = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
10633 __pyx_t_12 = __pyx_v_nDOF_trial_element;
10634 __pyx_t_13 = __pyx_t_12;
10635 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
10636 __pyx_v_j = __pyx_t_14;
10645 __pyx_t_15 = __pyx_v_eN;
10646 __pyx_t_16 = __pyx_v_j;
10648 if (__pyx_t_15 < 0) {
10649 __pyx_t_15 += __pyx_pybuffernd_u_l2g.diminfo[0].shape;
10650 if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 0;
10651 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_u_l2g.diminfo[0].shape)) __pyx_t_17 = 0;
10652 if (__pyx_t_16 < 0) {
10653 __pyx_t_16 += __pyx_pybuffernd_u_l2g.diminfo[1].shape;
10654 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1;
10655 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_u_l2g.diminfo[1].shape)) __pyx_t_17 = 1;
10656 if (unlikely(__pyx_t_17 != -1)) {
10657 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10658 __PYX_ERR(0, 415, __pyx_L1_error)
10660 __pyx_t_18 = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_u_l2g.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_u_l2g.diminfo[1].strides));
10662 if (__pyx_t_18 < 0) {
10663 __pyx_t_18 += __pyx_pybuffernd_u_dof.diminfo[0].shape;
10664 if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 0;
10665 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_u_dof.diminfo[0].shape)) __pyx_t_17 = 0;
10666 if (unlikely(__pyx_t_17 != -1)) {
10667 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10668 __PYX_ERR(0, 415, __pyx_L1_error)
10670 __pyx_v_u_j = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_u_dof.diminfo[0].strides));
10679 __pyx_t_19 = __pyx_v_eN;
10680 __pyx_t_20 = __pyx_v_j;
10682 if (__pyx_t_19 < 0) {
10683 __pyx_t_19 += __pyx_pybuffernd_q_u.diminfo[0].shape;
10684 if (unlikely(__pyx_t_19 < 0)) __pyx_t_17 = 0;
10685 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_q_u.diminfo[0].shape)) __pyx_t_17 = 0;
10686 if (__pyx_t_20 < 0) {
10687 __pyx_t_20 += __pyx_pybuffernd_q_u.diminfo[1].shape;
10688 if (unlikely(__pyx_t_20 < 0)) __pyx_t_17 = 1;
10689 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_u.diminfo[1].shape)) __pyx_t_17 = 1;
10690 if (unlikely(__pyx_t_17 != -1)) {
10691 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10692 __PYX_ERR(0, 416, __pyx_L1_error)
10694 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_u.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_q_u.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_q_u.diminfo[1].strides) = __pyx_v_u_j;
10703 __pyx_v_psiC = (-__pyx_v_u_j);
10712 __pyx_t_21 = __pyx_v_matID;
10714 if (__pyx_t_21 < 0) {
10715 __pyx_t_21 += __pyx_pybuffernd_n.diminfo[0].shape;
10716 if (unlikely(__pyx_t_21 < 0)) __pyx_t_17 = 0;
10717 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_17 = 0;
10718 if (unlikely(__pyx_t_17 != -1)) {
10719 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10720 __PYX_ERR(0, 420, __pyx_L1_error)
10722 __pyx_t_22 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_n.diminfo[0].strides));
10723 if (unlikely(__pyx_t_22 == 0)) {
10724 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10725 __PYX_ERR(0, 420, __pyx_L1_error)
10727 __pyx_v_m = (1.0 - (1.0 / __pyx_t_22));
10736 __pyx_t_23 = __pyx_v_matID;
10738 if (__pyx_t_23 < 0) {
10739 __pyx_t_23 += __pyx_pybuffernd_thetaR.diminfo[0].shape;
10740 if (unlikely(__pyx_t_23 < 0)) __pyx_t_17 = 0;
10741 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_thetaR.diminfo[0].shape)) __pyx_t_17 = 0;
10742 if (unlikely(__pyx_t_17 != -1)) {
10743 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10744 __PYX_ERR(0, 421, __pyx_L1_error)
10746 __pyx_t_24 = __pyx_v_matID;
10748 if (__pyx_t_24 < 0) {
10749 __pyx_t_24 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
10750 if (unlikely(__pyx_t_24 < 0)) __pyx_t_17 = 0;
10751 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_17 = 0;
10752 if (unlikely(__pyx_t_17 != -1)) {
10753 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10754 __PYX_ERR(0, 421, __pyx_L1_error)
10756 __pyx_v_thetaS = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_thetaR.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_thetaSR.diminfo[0].strides)));
10765 __pyx_t_6 = ((__pyx_v_psiC > 0.0) != 0);
10775 __pyx_t_25 = __pyx_v_matID;
10777 if (__pyx_t_25 < 0) {
10778 __pyx_t_25 += __pyx_pybuffernd_alpha.diminfo[0].shape;
10779 if (unlikely(__pyx_t_25 < 0)) __pyx_t_17 = 0;
10780 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_17 = 0;
10781 if (unlikely(__pyx_t_17 != -1)) {
10782 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10783 __PYX_ERR(0, 423, __pyx_L1_error)
10785 __pyx_v_pcBar = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_alpha.diminfo[0].strides)) * __pyx_v_psiC);
10794 __pyx_t_26 = __pyx_v_matID;
10796 if (__pyx_t_26 < 0) {
10797 __pyx_t_26 += __pyx_pybuffernd_n.diminfo[0].shape;
10798 if (unlikely(__pyx_t_26 < 0)) __pyx_t_17 = 0;
10799 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_17 = 0;
10800 if (unlikely(__pyx_t_17 != -1)) {
10801 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10802 __PYX_ERR(0, 424, __pyx_L1_error)
10804 __pyx_v_pcBar_nM2 = pow(__pyx_v_pcBar, ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_n.diminfo[0].strides)) - 2.0));
10813 __pyx_v_pcBar_nM1 = (__pyx_v_pcBar_nM2 * __pyx_v_pcBar);
10822 __pyx_v_pcBar_n = (__pyx_v_pcBar_nM1 * __pyx_v_pcBar);
10831 __pyx_v_onePlus_pcBar_n = (1.0 + __pyx_v_pcBar_n);
10840 __pyx_v_sBar = pow(__pyx_v_onePlus_pcBar_n, (-__pyx_v_m));
10849 __pyx_t_27 = __pyx_v_matID;
10851 if (__pyx_t_27 < 0) {
10852 __pyx_t_27 += __pyx_pybuffernd_alpha.diminfo[0].shape;
10853 if (unlikely(__pyx_t_27 < 0)) __pyx_t_17 = 0;
10854 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_17 = 0;
10855 if (unlikely(__pyx_t_17 != -1)) {
10856 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10857 __PYX_ERR(0, 431, __pyx_L1_error)
10859 __pyx_t_28 = __pyx_v_matID;
10861 if (__pyx_t_28 < 0) {
10862 __pyx_t_28 += __pyx_pybuffernd_n.diminfo[0].shape;
10863 if (unlikely(__pyx_t_28 < 0)) __pyx_t_17 = 0;
10864 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_17 = 0;
10865 if (unlikely(__pyx_t_17 != -1)) {
10866 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10867 __PYX_ERR(0, 431, __pyx_L1_error)
10869 if (unlikely(__pyx_v_onePlus_pcBar_n == 0)) {
10870 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10871 __PYX_ERR(0, 431, __pyx_L1_error)
10873 __pyx_v_DsBar_DpsiC = ((((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_alpha.diminfo[0].strides)) * (1.0 - (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_n.diminfo[0].strides)))) * (__pyx_v_sBar / __pyx_v_onePlus_pcBar_n)) * __pyx_v_pcBar_nM1);
10882 __pyx_v_vBar = (1.0 - (__pyx_v_pcBar_nM1 * __pyx_v_sBar));
10891 __pyx_v_vBar2 = (__pyx_v_vBar * __pyx_v_vBar);
10900 __pyx_t_29 = __pyx_v_matID;
10902 if (__pyx_t_29 < 0) {
10903 __pyx_t_29 += __pyx_pybuffernd_alpha.diminfo[0].shape;
10904 if (unlikely(__pyx_t_29 < 0)) __pyx_t_17 = 0;
10905 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_17 = 0;
10906 if (unlikely(__pyx_t_17 != -1)) {
10907 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10908 __PYX_ERR(0, 435, __pyx_L1_error)
10910 __pyx_t_30 = __pyx_v_matID;
10912 if (__pyx_t_30 < 0) {
10913 __pyx_t_30 += __pyx_pybuffernd_n.diminfo[0].shape;
10914 if (unlikely(__pyx_t_30 < 0)) __pyx_t_17 = 0;
10915 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_17 = 0;
10916 if (unlikely(__pyx_t_17 != -1)) {
10917 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10918 __PYX_ERR(0, 435, __pyx_L1_error)
10920 __pyx_v_DvBar_DpsiC = (((((-(*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_alpha.diminfo[0].strides))) * ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_n.diminfo[0].strides)) - 1.0)) * __pyx_v_pcBar_nM2) * __pyx_v_sBar) - (__pyx_v_pcBar_nM1 * __pyx_v_DsBar_DpsiC));
10929 __pyx_t_31 = __pyx_v_matID;
10931 if (__pyx_t_31 < 0) {
10932 __pyx_t_31 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
10933 if (unlikely(__pyx_t_31 < 0)) __pyx_t_17 = 0;
10934 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_17 = 0;
10935 if (unlikely(__pyx_t_17 != -1)) {
10936 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10937 __PYX_ERR(0, 437, __pyx_L1_error)
10939 __pyx_t_32 = __pyx_v_matID;
10941 if (__pyx_t_32 < 0) {
10942 __pyx_t_32 += __pyx_pybuffernd_thetaR.diminfo[0].shape;
10943 if (unlikely(__pyx_t_32 < 0)) __pyx_t_17 = 0;
10944 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_thetaR.diminfo[0].shape)) __pyx_t_17 = 0;
10945 if (unlikely(__pyx_t_17 != -1)) {
10946 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10947 __PYX_ERR(0, 437, __pyx_L1_error)
10949 __pyx_v_thetaW = (((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_thetaSR.diminfo[0].strides)) * __pyx_v_sBar) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_thetaR.diminfo[0].strides)));
10958 __pyx_t_33 = __pyx_v_matID;
10960 if (__pyx_t_33 < 0) {
10961 __pyx_t_33 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
10962 if (unlikely(__pyx_t_33 < 0)) __pyx_t_17 = 0;
10963 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_17 = 0;
10964 if (unlikely(__pyx_t_17 != -1)) {
10965 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10966 __PYX_ERR(0, 438, __pyx_L1_error)
10968 __pyx_v_DthetaW_DpsiC = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_thetaSR.diminfo[0].strides)) * __pyx_v_DsBar_DpsiC);
10977 __pyx_v_sqrt_sBar = sqrt(__pyx_v_sBar);
10986 __pyx_v_KWr = (__pyx_v_sqrt_sBar * __pyx_v_vBar2);
10995 if (unlikely(__pyx_v_sqrt_sBar == 0)) {
10996 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10997 __PYX_ERR(0, 442, __pyx_L1_error)
10999 __pyx_v_DKWr_DpsiC = ((((0.5 / __pyx_v_sqrt_sBar) * __pyx_v_DsBar_DpsiC) * __pyx_v_vBar2) + (((2.0 * __pyx_v_sqrt_sBar) * __pyx_v_vBar) * __pyx_v_DvBar_DpsiC));
11019 __pyx_v_thetaW = __pyx_v_thetaS;
11028 __pyx_v_DthetaW_DpsiC = 0.0;
11046 __pyx_v_DKWr_DpsiC = 0.0;
11057 __pyx_v_rhom = (__pyx_v_rho * exp((__pyx_v_beta * __pyx_v_u_j)));
11066 __pyx_v_drhom = (__pyx_v_beta * __pyx_v_rhom);
11075 __pyx_t_34 = __pyx_v_eN;
11076 __pyx_t_35 = __pyx_v_j;
11078 if (__pyx_t_34 < 0) {
11079 __pyx_t_34 += __pyx_pybuffernd_q_mass.diminfo[0].shape;
11080 if (unlikely(__pyx_t_34 < 0)) __pyx_t_17 = 0;
11081 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_q_mass.diminfo[0].shape)) __pyx_t_17 = 0;
11082 if (__pyx_t_35 < 0) {
11083 __pyx_t_35 += __pyx_pybuffernd_q_mass.diminfo[1].shape;
11084 if (unlikely(__pyx_t_35 < 0)) __pyx_t_17 = 1;
11085 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_q_mass.diminfo[1].shape)) __pyx_t_17 = 1;
11086 if (unlikely(__pyx_t_17 != -1)) {
11087 __Pyx_RaiseBufferIndexError(__pyx_t_17);
11088 __PYX_ERR(0, 451, __pyx_L1_error)
11090 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_q_mass.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_q_mass.diminfo[1].strides) = (__pyx_v_rhom * __pyx_v_thetaW);
11099 __pyx_t_36 = __pyx_v_eN;
11100 __pyx_t_37 = __pyx_v_j;
11102 if (__pyx_t_36 < 0) {
11103 __pyx_t_36 += __pyx_pybuffernd_q_dmass.diminfo[0].shape;
11104 if (unlikely(__pyx_t_36 < 0)) __pyx_t_17 = 0;
11105 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_q_dmass.diminfo[0].shape)) __pyx_t_17 = 0;
11106 if (__pyx_t_37 < 0) {
11107 __pyx_t_37 += __pyx_pybuffernd_q_dmass.diminfo[1].shape;
11108 if (unlikely(__pyx_t_37 < 0)) __pyx_t_17 = 1;
11109 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_q_dmass.diminfo[1].shape)) __pyx_t_17 = 1;
11110 if (unlikely(__pyx_t_17 != -1)) {
11111 __Pyx_RaiseBufferIndexError(__pyx_t_17);
11112 __PYX_ERR(0, 452, __pyx_L1_error)
11114 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_q_dmass.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_q_dmass.diminfo[1].strides) = (((-__pyx_v_rhom) * __pyx_v_DthetaW_DpsiC) + (__pyx_v_drhom * __pyx_v_thetaW));
11123 __pyx_t_38 = __pyx_v_eN;
11124 __pyx_t_39 = __pyx_v_j;
11126 if (__pyx_t_38 < 0) {
11127 __pyx_t_38 += __pyx_pybuffernd_q_kr.diminfo[0].shape;
11128 if (unlikely(__pyx_t_38 < 0)) __pyx_t_17 = 0;
11129 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_q_kr.diminfo[0].shape)) __pyx_t_17 = 0;
11130 if (__pyx_t_39 < 0) {
11131 __pyx_t_39 += __pyx_pybuffernd_q_kr.diminfo[1].shape;
11132 if (unlikely(__pyx_t_39 < 0)) __pyx_t_17 = 1;
11133 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_q_kr.diminfo[1].shape)) __pyx_t_17 = 1;
11134 if (unlikely(__pyx_t_17 != -1)) {
11135 __Pyx_RaiseBufferIndexError(__pyx_t_17);
11136 __PYX_ERR(0, 454, __pyx_L1_error)
11138 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_q_kr.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_q_kr.diminfo[1].strides) = __pyx_v_KWr;
11147 __pyx_t_40 = __pyx_v_eN;
11148 __pyx_t_41 = __pyx_v_j;
11150 if (__pyx_t_40 < 0) {
11151 __pyx_t_40 += __pyx_pybuffernd_q_dkr.diminfo[0].shape;
11152 if (unlikely(__pyx_t_40 < 0)) __pyx_t_17 = 0;
11153 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_q_dkr.diminfo[0].shape)) __pyx_t_17 = 0;
11154 if (__pyx_t_41 < 0) {
11155 __pyx_t_41 += __pyx_pybuffernd_q_dkr.diminfo[1].shape;
11156 if (unlikely(__pyx_t_41 < 0)) __pyx_t_17 = 1;
11157 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_q_dkr.diminfo[1].shape)) __pyx_t_17 = 1;
11158 if (unlikely(__pyx_t_17 != -1)) {
11159 __Pyx_RaiseBufferIndexError(__pyx_t_17);
11160 __PYX_ERR(0, 455, __pyx_L1_error)
11162 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_q_dkr.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_q_dkr.diminfo[1].strides) = (-__pyx_v_DKWr_DpsiC);
11173 __pyx_t_8 = __pyx_v_nElements_global;
11174 __pyx_t_9 = __pyx_t_8;
11175 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
11176 __pyx_v_eN = __pyx_t_10;
11185 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
11186 __Pyx_GOTREF(__pyx_t_5);
11187 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
11188 __Pyx_GOTREF(__pyx_t_1);
11189 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11190 __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_u), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
11191 __Pyx_GOTREF(__pyx_t_5);
11193 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
11194 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
11195 if (likely(__pyx_t_4)) {
11196 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
11197 __Pyx_INCREF(__pyx_t_4);
11198 __Pyx_INCREF(
function);
11199 __Pyx_DECREF_SET(__pyx_t_1,
function);
11202 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
11203 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11204 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11205 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
11206 __Pyx_GOTREF(__pyx_t_2);
11207 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11208 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
11209 __Pyx_GOTREF(__pyx_t_1);
11210 __pyx_t_5 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
11211 __Pyx_GOTREF(__pyx_t_5);
11212 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11213 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11214 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_5);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error)
11215 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11216 __pyx_v_u_eN = __pyx_t_7;
11225 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
11226 __Pyx_GOTREF(__pyx_t_1);
11227 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
11228 __Pyx_GOTREF(__pyx_t_2);
11229 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11230 __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_kr), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
11231 __Pyx_GOTREF(__pyx_t_1);
11233 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11234 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
11235 if (likely(__pyx_t_4)) {
11236 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11237 __Pyx_INCREF(__pyx_t_4);
11238 __Pyx_INCREF(
function);
11239 __Pyx_DECREF_SET(__pyx_t_2,
function);
11242 __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
11243 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11244 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11245 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error)
11246 __Pyx_GOTREF(__pyx_t_5);
11247 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11248 __pyx_t_2 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
11249 __Pyx_GOTREF(__pyx_t_2);
11250 __pyx_t_1 = PyNumber_Multiply(__pyx_t_5, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
11251 __Pyx_GOTREF(__pyx_t_1);
11252 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11253 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11254 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L1_error)
11255 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11256 __pyx_v_kr_eN = __pyx_t_7;
11265 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_u_eN);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
11266 __Pyx_GOTREF(__pyx_t_1);
11267 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error)
11268 __Pyx_GOTREF(__pyx_t_5);
11269 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dot);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error)
11270 __Pyx_GOTREF(__pyx_t_4);
11271 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11272 __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error)
11273 __Pyx_GOTREF(__pyx_t_5);
11276 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
11277 __pyx_t_42 = PyMethod_GET_SELF(__pyx_t_4);
11278 if (likely(__pyx_t_42)) {
11279 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
11280 __Pyx_INCREF(__pyx_t_42);
11281 __Pyx_INCREF(
function);
11282 __Pyx_DECREF_SET(__pyx_t_4,
function);
11286 #if CYTHON_FAST_PYCALL 11287 if (PyFunction_Check(__pyx_t_4)) {
11288 PyObject *__pyx_temp[3] = {__pyx_t_42, ((PyObject *)__pyx_v_gravity), __pyx_t_5};
11289 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
11290 __Pyx_XDECREF(__pyx_t_42); __pyx_t_42 = 0;
11291 __Pyx_GOTREF(__pyx_t_2);
11292 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11295 #if CYTHON_FAST_PYCCALL 11296 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
11297 PyObject *__pyx_temp[3] = {__pyx_t_42, ((PyObject *)__pyx_v_gravity), __pyx_t_5};
11298 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
11299 __Pyx_XDECREF(__pyx_t_42); __pyx_t_42 = 0;
11300 __Pyx_GOTREF(__pyx_t_2);
11301 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11305 __pyx_t_43 = PyTuple_New(2+__pyx_t_12);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 465, __pyx_L1_error)
11306 __Pyx_GOTREF(__pyx_t_43);
11308 __Pyx_GIVEREF(__pyx_t_42); PyTuple_SET_ITEM(__pyx_t_43, 0, __pyx_t_42); __pyx_t_42 = NULL;
11310 __Pyx_INCREF(((PyObject *)__pyx_v_gravity));
11311 __Pyx_GIVEREF(((PyObject *)__pyx_v_gravity));
11312 PyTuple_SET_ITEM(__pyx_t_43, 0+__pyx_t_12, ((PyObject *)__pyx_v_gravity));
11313 __Pyx_GIVEREF(__pyx_t_5);
11314 PyTuple_SET_ITEM(__pyx_t_43, 1+__pyx_t_12, __pyx_t_5);
11316 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_43, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
11317 __Pyx_GOTREF(__pyx_t_2);
11318 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11320 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11321 __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error)
11322 __Pyx_GOTREF(__pyx_t_4);
11323 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11324 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11325 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 465, __pyx_L1_error)
11326 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11327 __pyx_v_phi_eN = __pyx_t_7;
11336 __pyx_t_12 = __pyx_v_nElementBoundaries_element;
11337 __pyx_t_13 = __pyx_t_12;
11338 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
11339 __pyx_v_ebN = __pyx_t_14;
11348 __pyx_t_44 = __pyx_v_eN;
11349 __pyx_t_45 = __pyx_v_ebN;
11351 if (__pyx_t_44 < 0) {
11352 __pyx_t_44 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
11353 if (unlikely(__pyx_t_44 < 0)) __pyx_t_17 = 0;
11354 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_17 = 0;
11355 if (__pyx_t_45 < 0) {
11356 __pyx_t_45 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
11357 if (unlikely(__pyx_t_45 < 0)) __pyx_t_17 = 1;
11358 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_17 = 1;
11359 if (unlikely(__pyx_t_17 != -1)) {
11360 __Pyx_RaiseBufferIndexError(__pyx_t_17);
11361 __PYX_ERR(0, 471, __pyx_L1_error)
11363 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_q_kr_up.diminfo[1].strides) = __pyx_v_kr_eN;
11372 __pyx_t_46 = __pyx_v_eN;
11373 __pyx_t_47 = __pyx_v_ebN;
11375 if (__pyx_t_46 < 0) {
11376 __pyx_t_46 += __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape;
11377 if (unlikely(__pyx_t_46 < 0)) __pyx_t_17 = 0;
11378 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape)) __pyx_t_17 = 0;
11379 if (__pyx_t_47 < 0) {
11380 __pyx_t_47 += __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape;
11381 if (unlikely(__pyx_t_47 < 0)) __pyx_t_17 = 1;
11382 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape)) __pyx_t_17 = 1;
11383 if (unlikely(__pyx_t_17 != -1)) {
11384 __Pyx_RaiseBufferIndexError(__pyx_t_17);
11385 __PYX_ERR(0, 472, __pyx_L1_error)
11387 __pyx_v_eN_neighbor = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides));
11396 __pyx_t_6 = ((__pyx_v_eN_neighbor >= 0) != 0);
11406 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
11407 __Pyx_GOTREF(__pyx_t_2);
11408 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
11409 __Pyx_GOTREF(__pyx_t_1);
11410 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11411 __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_u), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
11412 __Pyx_GOTREF(__pyx_t_2);
11414 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
11415 __pyx_t_43 = PyMethod_GET_SELF(__pyx_t_1);
11416 if (likely(__pyx_t_43)) {
11417 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
11418 __Pyx_INCREF(__pyx_t_43);
11419 __Pyx_INCREF(
function);
11420 __Pyx_DECREF_SET(__pyx_t_1,
function);
11423 __pyx_t_4 = (__pyx_t_43) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_43, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
11424 __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0;
11425 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11426 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error)
11427 __Pyx_GOTREF(__pyx_t_4);
11428 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11429 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
11430 __Pyx_GOTREF(__pyx_t_1);
11431 __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
11432 __Pyx_GOTREF(__pyx_t_2);
11433 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11434 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11435 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 474, __pyx_L1_error)
11436 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11437 __pyx_v_u_neig = __pyx_t_7;
11446 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
11447 __Pyx_GOTREF(__pyx_t_1);
11448 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error)
11449 __Pyx_GOTREF(__pyx_t_4);
11450 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11451 __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_kr), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
11452 __Pyx_GOTREF(__pyx_t_1);
11454 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
11455 __pyx_t_43 = PyMethod_GET_SELF(__pyx_t_4);
11456 if (likely(__pyx_t_43)) {
11457 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
11458 __Pyx_INCREF(__pyx_t_43);
11459 __Pyx_INCREF(
function);
11460 __Pyx_DECREF_SET(__pyx_t_4,
function);
11463 __pyx_t_2 = (__pyx_t_43) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_43, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1);
11464 __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0;
11465 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11466 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
11467 __Pyx_GOTREF(__pyx_t_2);
11468 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11469 __pyx_t_4 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error)
11470 __Pyx_GOTREF(__pyx_t_4);
11471 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
11472 __Pyx_GOTREF(__pyx_t_1);
11473 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11474 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11475 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 475, __pyx_L1_error)
11476 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11477 __pyx_v_kr_neig = __pyx_t_7;
11486 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_u_neig);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
11487 __Pyx_GOTREF(__pyx_t_1);
11488 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
11489 __Pyx_GOTREF(__pyx_t_2);
11490 __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dot);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 477, __pyx_L1_error)
11491 __Pyx_GOTREF(__pyx_t_43);
11492 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11493 __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
11494 __Pyx_GOTREF(__pyx_t_2);
11497 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_43))) {
11498 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_43);
11499 if (likely(__pyx_t_5)) {
11500 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_43);
11501 __Pyx_INCREF(__pyx_t_5);
11502 __Pyx_INCREF(
function);
11503 __Pyx_DECREF_SET(__pyx_t_43,
function);
11507 #if CYTHON_FAST_PYCALL 11508 if (PyFunction_Check(__pyx_t_43)) {
11509 PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_gravity), __pyx_t_2};
11510 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_43, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
11511 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11512 __Pyx_GOTREF(__pyx_t_4);
11513 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11516 #if CYTHON_FAST_PYCCALL 11517 if (__Pyx_PyFastCFunction_Check(__pyx_t_43)) {
11518 PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_gravity), __pyx_t_2};
11519 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_43, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
11520 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11521 __Pyx_GOTREF(__pyx_t_4);
11522 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11526 __pyx_t_42 = PyTuple_New(2+__pyx_t_17);
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 477, __pyx_L1_error)
11527 __Pyx_GOTREF(__pyx_t_42);
11529 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_42, 0, __pyx_t_5); __pyx_t_5 = NULL;
11531 __Pyx_INCREF(((PyObject *)__pyx_v_gravity));
11532 __Pyx_GIVEREF(((PyObject *)__pyx_v_gravity));
11533 PyTuple_SET_ITEM(__pyx_t_42, 0+__pyx_t_17, ((PyObject *)__pyx_v_gravity));
11534 __Pyx_GIVEREF(__pyx_t_2);
11535 PyTuple_SET_ITEM(__pyx_t_42, 1+__pyx_t_17, __pyx_t_2);
11537 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_43, __pyx_t_42, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
11538 __Pyx_GOTREF(__pyx_t_4);
11539 __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
11541 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11542 __pyx_t_43 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 477, __pyx_L1_error)
11543 __Pyx_GOTREF(__pyx_t_43);
11544 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11545 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11546 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_43);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 477, __pyx_L1_error)
11547 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11548 __pyx_v_phi_neig = __pyx_t_7;
11557 __pyx_t_6 = ((__pyx_v_phi_eN < __pyx_v_phi_neig) != 0);
11567 __pyx_t_48 = __pyx_v_eN;
11568 __pyx_t_49 = __pyx_v_ebN;
11570 if (__pyx_t_48 < 0) {
11571 __pyx_t_48 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
11572 if (unlikely(__pyx_t_48 < 0)) __pyx_t_17 = 0;
11573 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_17 = 0;
11574 if (__pyx_t_49 < 0) {
11575 __pyx_t_49 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
11576 if (unlikely(__pyx_t_49 < 0)) __pyx_t_17 = 1;
11577 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_17 = 1;
11578 if (unlikely(__pyx_t_17 != -1)) {
11579 __Pyx_RaiseBufferIndexError(__pyx_t_17);
11580 __PYX_ERR(0, 480, __pyx_L1_error)
11582 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_q_kr_up.diminfo[1].strides) = __pyx_v_kr_neig;
11613 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11616 __Pyx_XDECREF(__pyx_t_1);
11617 __Pyx_XDECREF(__pyx_t_2);
11618 __Pyx_XDECREF(__pyx_t_4);
11619 __Pyx_XDECREF(__pyx_t_5);
11620 __Pyx_XDECREF(__pyx_t_42);
11621 __Pyx_XDECREF(__pyx_t_43);
11622 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
11623 __Pyx_PyThreadState_declare
11624 __Pyx_PyThreadState_assign
11625 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
11626 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer);
11627 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
11628 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
11629 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
11630 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
11631 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
11632 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
11633 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer);
11634 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
11635 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
11636 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer);
11637 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
11638 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
11639 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer);
11640 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer);
11641 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer);
11642 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer);
11643 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer);
11644 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
11645 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_VGM", __pyx_clineno, __pyx_lineno, __pyx_filename);
11649 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer);
11650 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
11651 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
11652 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
11653 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
11654 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
11655 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
11656 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer);
11657 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
11658 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
11659 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer);
11660 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
11661 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
11662 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer);
11663 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer);
11664 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer);
11665 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer);
11666 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer);
11668 __Pyx_XDECREF(__pyx_v_q);
11669 __Pyx_XGIVEREF(__pyx_r);
11670 __Pyx_RefNannyFinishContext();
11683 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
11684 static char __pyx_doc_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual[] =
"\n residual routine for NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n upwinds relative permeability based on element averages\n applies dirichlet boundary conditions strongly but keeps dofs in system\n\n TODO:\n everything\n \n ";
11685 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual = {
"RE_NCP1_getElementResidual", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual};
11686 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11687 CYTHON_UNUSED PyArrayObject *__pyx_v_gravity = 0;
11688 PyArrayObject *__pyx_v_rowptr = 0;
11689 PyArrayObject *__pyx_v_colind = 0;
11690 int __pyx_v_nSpace;
11691 int __pyx_v_nElements_global;
11692 int __pyx_v_nElementBoundaries_element;
11693 CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray = 0;
11694 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray = 0;
11695 int __pyx_v_nDOF_test_element;
11696 PyArrayObject *__pyx_v_q_u = 0;
11697 PyArrayObject *__pyx_v_q_grad_u = 0;
11698 PyArrayObject *__pyx_v_q_grad_w = 0;
11699 PyArrayObject *__pyx_v_q_detJ = 0;
11700 PyArrayObject *__pyx_v_q_m = 0;
11701 PyArrayObject *__pyx_v_q_mt = 0;
11702 PyArrayObject *__pyx_v_q_r = 0;
11703 PyArrayObject *__pyx_v_q_kr = 0;
11704 PyArrayObject *__pyx_v_q_kr_up = 0;
11705 PyArrayObject *__pyx_v_q_flin = 0;
11706 PyArrayObject *__pyx_v_q_alin = 0;
11707 PyArrayObject *__pyx_v_elementResidual = 0;
11708 PyObject *__pyx_r = 0;
11709 __Pyx_RefNannyDeclarations
11710 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementResidual (wrapper)", 0);
11712 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_nDOF_test_element,&__pyx_n_s_q_u,&__pyx_n_s_q_grad_u,&__pyx_n_s_q_grad_w,&__pyx_n_s_q_detJ,&__pyx_n_s_q_m,&__pyx_n_s_q_mt,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_kr_up,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,&__pyx_n_s_elementResidual,0};
11713 PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
11714 if (unlikely(__pyx_kwds)) {
11715 Py_ssize_t kw_args;
11716 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11717 switch (pos_args) {
11718 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
11719 CYTHON_FALLTHROUGH;
11720 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
11721 CYTHON_FALLTHROUGH;
11722 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
11723 CYTHON_FALLTHROUGH;
11724 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
11725 CYTHON_FALLTHROUGH;
11726 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
11727 CYTHON_FALLTHROUGH;
11728 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
11729 CYTHON_FALLTHROUGH;
11730 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
11731 CYTHON_FALLTHROUGH;
11732 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
11733 CYTHON_FALLTHROUGH;
11734 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
11735 CYTHON_FALLTHROUGH;
11736 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
11737 CYTHON_FALLTHROUGH;
11738 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
11739 CYTHON_FALLTHROUGH;
11740 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
11741 CYTHON_FALLTHROUGH;
11742 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
11743 CYTHON_FALLTHROUGH;
11744 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
11745 CYTHON_FALLTHROUGH;
11746 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11747 CYTHON_FALLTHROUGH;
11748 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11749 CYTHON_FALLTHROUGH;
11750 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11751 CYTHON_FALLTHROUGH;
11752 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11753 CYTHON_FALLTHROUGH;
11754 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11755 CYTHON_FALLTHROUGH;
11756 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11757 CYTHON_FALLTHROUGH;
11758 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11759 CYTHON_FALLTHROUGH;
11761 default:
goto __pyx_L5_argtuple_error;
11763 kw_args = PyDict_Size(__pyx_kwds);
11764 switch (pos_args) {
11766 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
11767 else goto __pyx_L5_argtuple_error;
11768 CYTHON_FALLTHROUGH;
11770 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
11772 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 1); __PYX_ERR(0, 486, __pyx_L3_error)
11774 CYTHON_FALLTHROUGH;
11776 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
11778 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 2); __PYX_ERR(0, 486, __pyx_L3_error)
11780 CYTHON_FALLTHROUGH;
11782 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
11784 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 3); __PYX_ERR(0, 486, __pyx_L3_error)
11786 CYTHON_FALLTHROUGH;
11788 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
11790 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 4); __PYX_ERR(0, 486, __pyx_L3_error)
11792 CYTHON_FALLTHROUGH;
11794 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
11796 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 5); __PYX_ERR(0, 486, __pyx_L3_error)
11798 CYTHON_FALLTHROUGH;
11800 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
11802 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 6); __PYX_ERR(0, 486, __pyx_L3_error)
11804 CYTHON_FALLTHROUGH;
11806 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
11808 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 7); __PYX_ERR(0, 486, __pyx_L3_error)
11810 CYTHON_FALLTHROUGH;
11812 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_test_element)) != 0)) kw_args--;
11814 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 8); __PYX_ERR(0, 486, __pyx_L3_error)
11816 CYTHON_FALLTHROUGH;
11818 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
11820 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 9); __PYX_ERR(0, 486, __pyx_L3_error)
11822 CYTHON_FALLTHROUGH;
11824 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_u)) != 0)) kw_args--;
11826 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 10); __PYX_ERR(0, 486, __pyx_L3_error)
11828 CYTHON_FALLTHROUGH;
11830 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_w)) != 0)) kw_args--;
11832 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 11); __PYX_ERR(0, 486, __pyx_L3_error)
11834 CYTHON_FALLTHROUGH;
11836 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_detJ)) != 0)) kw_args--;
11838 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 12); __PYX_ERR(0, 486, __pyx_L3_error)
11840 CYTHON_FALLTHROUGH;
11842 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_m)) != 0)) kw_args--;
11844 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 13); __PYX_ERR(0, 486, __pyx_L3_error)
11846 CYTHON_FALLTHROUGH;
11848 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_mt)) != 0)) kw_args--;
11850 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 14); __PYX_ERR(0, 486, __pyx_L3_error)
11852 CYTHON_FALLTHROUGH;
11854 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
11856 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 15); __PYX_ERR(0, 486, __pyx_L3_error)
11858 CYTHON_FALLTHROUGH;
11860 if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
11862 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 16); __PYX_ERR(0, 486, __pyx_L3_error)
11864 CYTHON_FALLTHROUGH;
11866 if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
11868 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 17); __PYX_ERR(0, 486, __pyx_L3_error)
11870 CYTHON_FALLTHROUGH;
11872 if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
11874 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 18); __PYX_ERR(0, 486, __pyx_L3_error)
11876 CYTHON_FALLTHROUGH;
11878 if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
11880 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 19); __PYX_ERR(0, 486, __pyx_L3_error)
11882 CYTHON_FALLTHROUGH;
11884 if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementResidual)) != 0)) kw_args--;
11886 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 20); __PYX_ERR(0, 486, __pyx_L3_error)
11889 if (unlikely(kw_args > 0)) {
11890 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_getElementResidual") < 0)) __PYX_ERR(0, 486, __pyx_L3_error)
11892 }
else if (PyTuple_GET_SIZE(__pyx_args) != 21) {
11893 goto __pyx_L5_argtuple_error;
11895 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11896 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11897 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11898 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11899 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11900 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11901 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11902 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
11903 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
11904 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
11905 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
11906 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
11907 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
11908 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
11909 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
11910 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
11911 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
11912 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
11913 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
11914 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
11915 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
11917 __pyx_v_gravity = ((PyArrayObject *)values[0]);
11918 __pyx_v_rowptr = ((PyArrayObject *)values[1]);
11919 __pyx_v_colind = ((PyArrayObject *)values[2]);
11920 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L3_error)
11921 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 491, __pyx_L3_error)
11922 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 492, __pyx_L3_error)
11923 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[6]);
11924 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[7]);
11925 __pyx_v_nDOF_test_element = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nDOF_test_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L3_error)
11926 __pyx_v_q_u = ((PyArrayObject *)values[9]);
11927 __pyx_v_q_grad_u = ((PyArrayObject *)values[10]);
11928 __pyx_v_q_grad_w = ((PyArrayObject *)values[11]);
11929 __pyx_v_q_detJ = ((PyArrayObject *)values[12]);
11930 __pyx_v_q_m = ((PyArrayObject *)values[13]);
11931 __pyx_v_q_mt = ((PyArrayObject *)values[14]);
11932 __pyx_v_q_r = ((PyArrayObject *)values[15]);
11933 __pyx_v_q_kr = ((PyArrayObject *)values[16]);
11934 __pyx_v_q_kr_up = ((PyArrayObject *)values[17]);
11935 __pyx_v_q_flin = ((PyArrayObject *)values[18]);
11936 __pyx_v_q_alin = ((PyArrayObject *)values[19]);
11937 __pyx_v_elementResidual = ((PyArrayObject *)values[20]);
11939 goto __pyx_L4_argument_unpacking_done;
11940 __pyx_L5_argtuple_error:;
11941 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 486, __pyx_L3_error)
11943 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementResidual", __pyx_clineno, __pyx_lineno, __pyx_filename);
11944 __Pyx_RefNannyFinishContext();
11946 __pyx_L4_argument_unpacking_done:;
11947 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 486, __pyx_L1_error)
11948 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 487, __pyx_L1_error)
11949 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 488, __pyx_L1_error)
11950 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 493, __pyx_L1_error)
11951 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 494, __pyx_L1_error)
11952 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 497, __pyx_L1_error)
11953 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_u), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_u", 0))) __PYX_ERR(0, 498, __pyx_L1_error)
11954 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_w), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_w", 0))) __PYX_ERR(0, 499, __pyx_L1_error)
11955 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_detJ), __pyx_ptype_5numpy_ndarray, 1,
"q_detJ", 0))) __PYX_ERR(0, 501, __pyx_L1_error)
11956 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_m), __pyx_ptype_5numpy_ndarray, 1,
"q_m", 0))) __PYX_ERR(0, 502, __pyx_L1_error)
11957 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mt), __pyx_ptype_5numpy_ndarray, 1,
"q_mt", 0))) __PYX_ERR(0, 503, __pyx_L1_error)
11958 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) __PYX_ERR(0, 504, __pyx_L1_error)
11959 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) __PYX_ERR(0, 505, __pyx_L1_error)
11960 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) __PYX_ERR(0, 506, __pyx_L1_error)
11961 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) __PYX_ERR(0, 509, __pyx_L1_error)
11962 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) __PYX_ERR(0, 510, __pyx_L1_error)
11963 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementResidual), __pyx_ptype_5numpy_ndarray, 1,
"elementResidual", 0))) __PYX_ERR(0, 512, __pyx_L1_error)
11964 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(__pyx_self, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_nDOF_test_element, __pyx_v_q_u, __pyx_v_q_grad_u, __pyx_v_q_grad_w, __pyx_v_q_detJ, __pyx_v_q_m, __pyx_v_q_mt, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_kr_up, __pyx_v_q_flin, __pyx_v_q_alin, __pyx_v_elementResidual);
11971 __Pyx_RefNannyFinishContext();
11975 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementResidual) {
11976 CYTHON_UNUSED
int __pyx_v_upwindFlag;
11977 PyObject *__pyx_v_q = NULL;
11984 PyArrayObject *__pyx_v_a_up = 0;
11985 PyArrayObject *__pyx_v_f_up = 0;
11986 double __pyx_v_nAvgWeight;
11987 double __pyx_v_weight;
11988 double __pyx_v_volFactor;
11989 double __pyx_v_volume;
11990 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_up;
11991 __Pyx_Buffer __pyx_pybuffer_a_up;
11992 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
11993 __Pyx_Buffer __pyx_pybuffer_colind;
11994 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
11995 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
11996 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
11997 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
11998 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementResidual;
11999 __Pyx_Buffer __pyx_pybuffer_elementResidual;
12000 __Pyx_LocalBuf_ND __pyx_pybuffernd_f_up;
12001 __Pyx_Buffer __pyx_pybuffer_f_up;
12002 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
12003 __Pyx_Buffer __pyx_pybuffer_gravity;
12004 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
12005 __Pyx_Buffer __pyx_pybuffer_q_alin;
12006 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_detJ;
12007 __Pyx_Buffer __pyx_pybuffer_q_detJ;
12008 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
12009 __Pyx_Buffer __pyx_pybuffer_q_flin;
12010 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_u;
12011 __Pyx_Buffer __pyx_pybuffer_q_grad_u;
12012 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_w;
12013 __Pyx_Buffer __pyx_pybuffer_q_grad_w;
12014 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
12015 __Pyx_Buffer __pyx_pybuffer_q_kr;
12016 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
12017 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
12018 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_m;
12019 __Pyx_Buffer __pyx_pybuffer_q_m;
12020 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mt;
12021 __Pyx_Buffer __pyx_pybuffer_q_mt;
12022 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
12023 __Pyx_Buffer __pyx_pybuffer_q_r;
12024 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
12025 __Pyx_Buffer __pyx_pybuffer_q_u;
12026 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
12027 __Pyx_Buffer __pyx_pybuffer_rowptr;
12028 PyObject *__pyx_r = NULL;
12029 __Pyx_RefNannyDeclarations
12030 PyObject *__pyx_t_1 = NULL;
12031 PyObject *__pyx_t_2 = NULL;
12032 Py_ssize_t __pyx_t_3;
12033 PyObject *__pyx_t_4 = NULL;
12034 PyObject *__pyx_t_5 = NULL;
12036 Py_ssize_t __pyx_t_7;
12038 PyObject *__pyx_t_9 = NULL;
12039 PyArrayObject *__pyx_t_10 = NULL;
12040 PyArrayObject *__pyx_t_11 = NULL;
12044 Py_ssize_t __pyx_t_15;
12045 Py_ssize_t __pyx_t_16;
12049 Py_ssize_t __pyx_t_20;
12050 Py_ssize_t __pyx_t_21;
12052 Py_ssize_t __pyx_t_23;
12053 Py_ssize_t __pyx_t_24;
12054 Py_ssize_t __pyx_t_25;
12055 Py_ssize_t __pyx_t_26;
12056 Py_ssize_t __pyx_t_27;
12057 Py_ssize_t __pyx_t_28;
12063 Py_ssize_t __pyx_t_34;
12064 Py_ssize_t __pyx_t_35;
12065 Py_ssize_t __pyx_t_36;
12067 Py_ssize_t __pyx_t_38;
12068 Py_ssize_t __pyx_t_39;
12069 Py_ssize_t __pyx_t_40;
12070 Py_ssize_t __pyx_t_41;
12071 Py_ssize_t __pyx_t_42;
12072 Py_ssize_t __pyx_t_43;
12073 Py_ssize_t __pyx_t_44;
12074 Py_ssize_t __pyx_t_45;
12075 Py_ssize_t __pyx_t_46;
12076 Py_ssize_t __pyx_t_47;
12077 Py_ssize_t __pyx_t_48;
12078 Py_ssize_t __pyx_t_49;
12079 Py_ssize_t __pyx_t_50;
12080 Py_ssize_t __pyx_t_51;
12081 Py_ssize_t __pyx_t_52;
12082 Py_ssize_t __pyx_t_53;
12083 Py_ssize_t __pyx_t_54;
12084 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_55;
12085 Py_ssize_t __pyx_t_56;
12086 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_57;
12087 Py_ssize_t __pyx_t_58;
12089 Py_ssize_t __pyx_t_60;
12090 Py_ssize_t __pyx_t_61;
12091 Py_ssize_t __pyx_t_62;
12092 Py_ssize_t __pyx_t_63;
12093 Py_ssize_t __pyx_t_64;
12094 Py_ssize_t __pyx_t_65;
12095 Py_ssize_t __pyx_t_66;
12096 Py_ssize_t __pyx_t_67;
12097 Py_ssize_t __pyx_t_68;
12098 Py_ssize_t __pyx_t_69;
12099 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementResidual", 0);
12100 __pyx_pybuffer_a_up.pybuffer.buf = NULL;
12101 __pyx_pybuffer_a_up.refcount = 0;
12102 __pyx_pybuffernd_a_up.data = NULL;
12103 __pyx_pybuffernd_a_up.rcbuffer = &__pyx_pybuffer_a_up;
12104 __pyx_pybuffer_f_up.pybuffer.buf = NULL;
12105 __pyx_pybuffer_f_up.refcount = 0;
12106 __pyx_pybuffernd_f_up.data = NULL;
12107 __pyx_pybuffernd_f_up.rcbuffer = &__pyx_pybuffer_f_up;
12108 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
12109 __pyx_pybuffer_gravity.refcount = 0;
12110 __pyx_pybuffernd_gravity.data = NULL;
12111 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
12112 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
12113 __pyx_pybuffer_rowptr.refcount = 0;
12114 __pyx_pybuffernd_rowptr.data = NULL;
12115 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
12116 __pyx_pybuffer_colind.pybuffer.buf = NULL;
12117 __pyx_pybuffer_colind.refcount = 0;
12118 __pyx_pybuffernd_colind.data = NULL;
12119 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
12120 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
12121 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
12122 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
12123 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
12124 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
12125 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
12126 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
12127 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
12128 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
12129 __pyx_pybuffer_q_u.refcount = 0;
12130 __pyx_pybuffernd_q_u.data = NULL;
12131 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
12132 __pyx_pybuffer_q_grad_u.pybuffer.buf = NULL;
12133 __pyx_pybuffer_q_grad_u.refcount = 0;
12134 __pyx_pybuffernd_q_grad_u.data = NULL;
12135 __pyx_pybuffernd_q_grad_u.rcbuffer = &__pyx_pybuffer_q_grad_u;
12136 __pyx_pybuffer_q_grad_w.pybuffer.buf = NULL;
12137 __pyx_pybuffer_q_grad_w.refcount = 0;
12138 __pyx_pybuffernd_q_grad_w.data = NULL;
12139 __pyx_pybuffernd_q_grad_w.rcbuffer = &__pyx_pybuffer_q_grad_w;
12140 __pyx_pybuffer_q_detJ.pybuffer.buf = NULL;
12141 __pyx_pybuffer_q_detJ.refcount = 0;
12142 __pyx_pybuffernd_q_detJ.data = NULL;
12143 __pyx_pybuffernd_q_detJ.rcbuffer = &__pyx_pybuffer_q_detJ;
12144 __pyx_pybuffer_q_m.pybuffer.buf = NULL;
12145 __pyx_pybuffer_q_m.refcount = 0;
12146 __pyx_pybuffernd_q_m.data = NULL;
12147 __pyx_pybuffernd_q_m.rcbuffer = &__pyx_pybuffer_q_m;
12148 __pyx_pybuffer_q_mt.pybuffer.buf = NULL;
12149 __pyx_pybuffer_q_mt.refcount = 0;
12150 __pyx_pybuffernd_q_mt.data = NULL;
12151 __pyx_pybuffernd_q_mt.rcbuffer = &__pyx_pybuffer_q_mt;
12152 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
12153 __pyx_pybuffer_q_r.refcount = 0;
12154 __pyx_pybuffernd_q_r.data = NULL;
12155 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
12156 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
12157 __pyx_pybuffer_q_kr.refcount = 0;
12158 __pyx_pybuffernd_q_kr.data = NULL;
12159 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
12160 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
12161 __pyx_pybuffer_q_kr_up.refcount = 0;
12162 __pyx_pybuffernd_q_kr_up.data = NULL;
12163 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
12164 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
12165 __pyx_pybuffer_q_flin.refcount = 0;
12166 __pyx_pybuffernd_q_flin.data = NULL;
12167 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
12168 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
12169 __pyx_pybuffer_q_alin.refcount = 0;
12170 __pyx_pybuffernd_q_alin.data = NULL;
12171 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
12172 __pyx_pybuffer_elementResidual.pybuffer.buf = NULL;
12173 __pyx_pybuffer_elementResidual.refcount = 0;
12174 __pyx_pybuffernd_elementResidual.data = NULL;
12175 __pyx_pybuffernd_elementResidual.rcbuffer = &__pyx_pybuffer_elementResidual;
12177 __Pyx_BufFmt_StackElem __pyx_stack[1];
12178 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12180 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
12182 __Pyx_BufFmt_StackElem __pyx_stack[1];
12183 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12185 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
12187 __Pyx_BufFmt_StackElem __pyx_stack[1];
12188 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12190 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
12192 __Pyx_BufFmt_StackElem __pyx_stack[1];
12193 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12195 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
12197 __Pyx_BufFmt_StackElem __pyx_stack[1];
12198 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12200 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
12202 __Pyx_BufFmt_StackElem __pyx_stack[1];
12203 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12205 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
12207 __Pyx_BufFmt_StackElem __pyx_stack[1];
12208 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12210 __pyx_pybuffernd_q_grad_u.diminfo[0].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_u.diminfo[0].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_u.diminfo[1].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_u.diminfo[1].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_u.diminfo[2].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_u.diminfo[2].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[2];
12212 __Pyx_BufFmt_StackElem __pyx_stack[1];
12213 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12215 __pyx_pybuffernd_q_grad_w.diminfo[0].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_w.diminfo[0].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_w.diminfo[1].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_w.diminfo[1].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_w.diminfo[2].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_w.diminfo[2].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_w.diminfo[3].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_w.diminfo[3].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[3];
12217 __Pyx_BufFmt_StackElem __pyx_stack[1];
12218 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_detJ, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12220 __pyx_pybuffernd_q_detJ.diminfo[0].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_detJ.diminfo[0].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_detJ.diminfo[1].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_detJ.diminfo[1].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[1];
12222 __Pyx_BufFmt_StackElem __pyx_stack[1];
12223 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_m, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12225 __pyx_pybuffernd_q_m.diminfo[0].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_m.diminfo[0].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_m.diminfo[1].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_m.diminfo[1].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[1];
12227 __Pyx_BufFmt_StackElem __pyx_stack[1];
12228 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12230 __pyx_pybuffernd_q_mt.diminfo[0].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mt.diminfo[0].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mt.diminfo[1].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mt.diminfo[1].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[1];
12232 __Pyx_BufFmt_StackElem __pyx_stack[1];
12233 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12235 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
12237 __Pyx_BufFmt_StackElem __pyx_stack[1];
12238 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12240 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
12242 __Pyx_BufFmt_StackElem __pyx_stack[1];
12243 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12245 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
12247 __Pyx_BufFmt_StackElem __pyx_stack[1];
12248 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12250 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
12252 __Pyx_BufFmt_StackElem __pyx_stack[1];
12253 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12255 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
12257 __Pyx_BufFmt_StackElem __pyx_stack[1];
12258 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementResidual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12260 __pyx_pybuffernd_elementResidual.diminfo[0].strides = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementResidual.diminfo[0].shape = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementResidual.diminfo[1].strides = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementResidual.diminfo[1].shape = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.shape[1];
12269 __pyx_v_upwindFlag = 1;
12278 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
12279 __Pyx_GOTREF(__pyx_t_1);
12280 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
12281 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
12282 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
12283 __Pyx_INCREF(((PyObject *)__pyx_v_q_m));
12284 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_m));
12285 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_m));
12286 __Pyx_INCREF(((PyObject *)__pyx_v_q_mt));
12287 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mt));
12288 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_mt));
12289 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
12290 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
12291 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_r));
12292 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
12293 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
12294 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_kr));
12295 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
12296 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12298 if (__pyx_t_3 >= 5)
break;
12299 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 12300 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 529, __pyx_L1_error)
12302 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
12303 __Pyx_GOTREF(__pyx_t_1);
12305 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
12315 #ifndef CYTHON_WITHOUT_ASSERTIONS 12316 if (unlikely(!Py_OptimizeFlag)) {
12317 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
12318 __Pyx_GOTREF(__pyx_t_1);
12319 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error)
12320 __Pyx_GOTREF(__pyx_t_4);
12321 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12322 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
12323 __Pyx_GOTREF(__pyx_t_1);
12324 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 530, __pyx_L1_error)
12325 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12326 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12327 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 530, __pyx_L1_error)
12328 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12329 if (unlikely(!__pyx_t_6)) {
12330 PyErr_SetNone(PyExc_AssertionError);
12331 __PYX_ERR(0, 530, __pyx_L1_error)
12344 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12353 #ifndef CYTHON_WITHOUT_ASSERTIONS 12354 if (unlikely(!Py_OptimizeFlag)) {
12355 if (unlikely(!((__pyx_v_nDOF_test_element == (__pyx_v_nSpace + 1)) != 0))) {
12356 PyErr_SetNone(PyExc_AssertionError);
12357 __PYX_ERR(0, 531, __pyx_L1_error)
12369 __pyx_t_7 = __pyx_v_nSpace;
12371 if (__pyx_t_7 < 0) {
12372 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
12373 if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
12374 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_8 = 0;
12375 if (unlikely(__pyx_t_8 != -1)) {
12376 __Pyx_RaiseBufferIndexError(__pyx_t_8);
12377 __PYX_ERR(0, 532, __pyx_L1_error)
12379 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides));
12388 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
12389 __Pyx_GOTREF(__pyx_t_5);
12390 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
12391 __Pyx_GOTREF(__pyx_t_1);
12392 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12393 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
12394 __Pyx_GOTREF(__pyx_t_5);
12397 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
12398 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
12399 if (likely(__pyx_t_4)) {
12400 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
12401 __Pyx_INCREF(__pyx_t_4);
12402 __Pyx_INCREF(
function);
12403 __Pyx_DECREF_SET(__pyx_t_1,
function);
12407 #if CYTHON_FAST_PYCALL 12408 if (PyFunction_Check(__pyx_t_1)) {
12409 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
12410 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
12411 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12412 __Pyx_GOTREF(__pyx_t_2);
12413 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12416 #if CYTHON_FAST_PYCCALL 12417 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
12418 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
12419 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
12420 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12421 __Pyx_GOTREF(__pyx_t_2);
12422 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12426 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 536, __pyx_L1_error)
12427 __Pyx_GOTREF(__pyx_t_9);
12429 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
12431 __Pyx_GIVEREF(__pyx_t_5);
12432 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
12433 __Pyx_INCREF(__pyx_n_s_d);
12434 __Pyx_GIVEREF(__pyx_n_s_d);
12435 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_n_s_d);
12437 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
12438 __Pyx_GOTREF(__pyx_t_2);
12439 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12441 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12442 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 536, __pyx_L1_error)
12443 __pyx_t_10 = ((PyArrayObject *)__pyx_t_2);
12445 __Pyx_BufFmt_StackElem __pyx_stack[1];
12446 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
12447 __pyx_v_a_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf = NULL;
12448 __PYX_ERR(0, 536, __pyx_L1_error)
12449 }
else {__pyx_pybuffernd_a_up.diminfo[0].strides = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_up.diminfo[0].shape = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.shape[0];
12453 __pyx_v_a_up = ((PyArrayObject *)__pyx_t_2);
12463 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
12464 __Pyx_GOTREF(__pyx_t_1);
12465 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 537, __pyx_L1_error)
12466 __Pyx_GOTREF(__pyx_t_9);
12467 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12468 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nSpace);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
12469 __Pyx_GOTREF(__pyx_t_1);
12472 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
12473 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
12474 if (likely(__pyx_t_5)) {
12475 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
12476 __Pyx_INCREF(__pyx_t_5);
12477 __Pyx_INCREF(
function);
12478 __Pyx_DECREF_SET(__pyx_t_9,
function);
12482 #if CYTHON_FAST_PYCALL 12483 if (PyFunction_Check(__pyx_t_9)) {
12484 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
12485 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
12486 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12487 __Pyx_GOTREF(__pyx_t_2);
12488 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12491 #if CYTHON_FAST_PYCCALL 12492 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
12493 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
12494 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
12495 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12496 __Pyx_GOTREF(__pyx_t_2);
12497 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12501 __pyx_t_4 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error)
12502 __Pyx_GOTREF(__pyx_t_4);
12504 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
12506 __Pyx_GIVEREF(__pyx_t_1);
12507 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_t_1);
12508 __Pyx_INCREF(__pyx_n_s_d);
12509 __Pyx_GIVEREF(__pyx_n_s_d);
12510 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_n_s_d);
12512 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
12513 __Pyx_GOTREF(__pyx_t_2);
12514 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12516 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12517 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 537, __pyx_L1_error)
12518 __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
12520 __Pyx_BufFmt_StackElem __pyx_stack[1];
12521 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
12522 __pyx_v_f_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf = NULL;
12523 __PYX_ERR(0, 537, __pyx_L1_error)
12524 }
else {__pyx_pybuffernd_f_up.diminfo[0].strides = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_f_up.diminfo[0].shape = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.shape[0];
12528 __pyx_v_f_up = ((PyArrayObject *)__pyx_t_2);
12538 __pyx_t_12 = (__pyx_v_nSpace + 1.);
12539 if (unlikely(__pyx_t_12 == 0)) {
12540 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
12541 __PYX_ERR(0, 539, __pyx_L1_error)
12543 __pyx_v_nAvgWeight = (1.0 / __pyx_t_12);
12552 __pyx_v_weight = 1.0;
12553 __pyx_v_volFactor = 1.0;
12562 __pyx_t_6 = ((__pyx_v_nSpace == 2) != 0);
12572 __pyx_v_volFactor = 0.5;
12590 __pyx_t_6 = ((__pyx_v_nSpace == 3) != 0);
12600 __pyx_v_volFactor = (1.0 / 6.0);
12618 __pyx_t_8 = __pyx_v_nElements_global;
12619 __pyx_t_13 = __pyx_t_8;
12620 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
12621 __pyx_v_eN = __pyx_t_14;
12630 __pyx_t_15 = __pyx_v_eN;
12633 if (__pyx_t_15 < 0) {
12634 __pyx_t_15 += __pyx_pybuffernd_q_detJ.diminfo[0].shape;
12635 if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 0;
12636 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_detJ.diminfo[0].shape)) __pyx_t_17 = 0;
12637 if (__pyx_t_16 < 0) {
12638 __pyx_t_16 += __pyx_pybuffernd_q_detJ.diminfo[1].shape;
12639 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1;
12640 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_q_detJ.diminfo[1].shape)) __pyx_t_17 = 1;
12641 if (unlikely(__pyx_t_17 != -1)) {
12642 __Pyx_RaiseBufferIndexError(__pyx_t_17);
12643 __PYX_ERR(0, 547, __pyx_L1_error)
12645 __pyx_v_volume = (__pyx_v_volFactor * fabs((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_detJ.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_q_detJ.diminfo[1].strides))));
12654 __pyx_v_weight = (__pyx_v_nAvgWeight * __pyx_v_volume);
12663 __pyx_t_17 = __pyx_v_nDOF_test_element;
12664 __pyx_t_18 = __pyx_t_17;
12665 for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
12666 __pyx_v_i = __pyx_t_19;
12675 __pyx_t_20 = __pyx_v_eN;
12676 __pyx_t_21 = __pyx_v_i;
12678 if (__pyx_t_20 < 0) {
12679 __pyx_t_20 += __pyx_pybuffernd_q_mt.diminfo[0].shape;
12680 if (unlikely(__pyx_t_20 < 0)) __pyx_t_22 = 0;
12681 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_mt.diminfo[0].shape)) __pyx_t_22 = 0;
12682 if (__pyx_t_21 < 0) {
12683 __pyx_t_21 += __pyx_pybuffernd_q_mt.diminfo[1].shape;
12684 if (unlikely(__pyx_t_21 < 0)) __pyx_t_22 = 1;
12685 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_mt.diminfo[1].shape)) __pyx_t_22 = 1;
12686 if (unlikely(__pyx_t_22 != -1)) {
12687 __Pyx_RaiseBufferIndexError(__pyx_t_22);
12688 __PYX_ERR(0, 553, __pyx_L1_error)
12690 __pyx_t_23 = __pyx_v_eN;
12691 __pyx_t_24 = __pyx_v_i;
12693 if (__pyx_t_23 < 0) {
12694 __pyx_t_23 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
12695 if (unlikely(__pyx_t_23 < 0)) __pyx_t_22 = 0;
12696 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_22 = 0;
12697 if (__pyx_t_24 < 0) {
12698 __pyx_t_24 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
12699 if (unlikely(__pyx_t_24 < 0)) __pyx_t_22 = 1;
12700 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_22 = 1;
12701 if (unlikely(__pyx_t_22 != -1)) {
12702 __Pyx_RaiseBufferIndexError(__pyx_t_22);
12703 __PYX_ERR(0, 553, __pyx_L1_error)
12705 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_q_mt.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_q_mt.diminfo[1].strides)));
12714 __pyx_t_25 = __pyx_v_eN;
12715 __pyx_t_26 = __pyx_v_i;
12717 if (__pyx_t_25 < 0) {
12718 __pyx_t_25 += __pyx_pybuffernd_q_r.diminfo[0].shape;
12719 if (unlikely(__pyx_t_25 < 0)) __pyx_t_22 = 0;
12720 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_q_r.diminfo[0].shape)) __pyx_t_22 = 0;
12721 if (__pyx_t_26 < 0) {
12722 __pyx_t_26 += __pyx_pybuffernd_q_r.diminfo[1].shape;
12723 if (unlikely(__pyx_t_26 < 0)) __pyx_t_22 = 1;
12724 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_q_r.diminfo[1].shape)) __pyx_t_22 = 1;
12725 if (unlikely(__pyx_t_22 != -1)) {
12726 __Pyx_RaiseBufferIndexError(__pyx_t_22);
12727 __PYX_ERR(0, 555, __pyx_L1_error)
12729 __pyx_t_27 = __pyx_v_eN;
12730 __pyx_t_28 = __pyx_v_i;
12732 if (__pyx_t_27 < 0) {
12733 __pyx_t_27 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
12734 if (unlikely(__pyx_t_27 < 0)) __pyx_t_22 = 0;
12735 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_22 = 0;
12736 if (__pyx_t_28 < 0) {
12737 __pyx_t_28 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
12738 if (unlikely(__pyx_t_28 < 0)) __pyx_t_22 = 1;
12739 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_22 = 1;
12740 if (unlikely(__pyx_t_22 != -1)) {
12741 __Pyx_RaiseBufferIndexError(__pyx_t_22);
12742 __PYX_ERR(0, 555, __pyx_L1_error)
12744 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_r.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_q_r.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_q_r.diminfo[1].strides)));
12753 __pyx_t_22 = __pyx_v_nElementBoundaries_element;
12754 __pyx_t_29 = __pyx_t_22;
12755 for (__pyx_t_30 = 0; __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) {
12756 __pyx_v_ebN = __pyx_t_30;
12765 __pyx_t_31 = __pyx_v_nnz;
12766 __pyx_t_32 = __pyx_t_31;
12767 for (__pyx_t_33 = 0; __pyx_t_33 < __pyx_t_32; __pyx_t_33+=1) {
12768 __pyx_v_ii = __pyx_t_33;
12777 __pyx_t_34 = __pyx_v_eN;
12778 __pyx_t_35 = __pyx_v_ebN;
12779 __pyx_t_36 = __pyx_v_ii;
12781 if (__pyx_t_34 < 0) {
12782 __pyx_t_34 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
12783 if (unlikely(__pyx_t_34 < 0)) __pyx_t_37 = 0;
12784 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_37 = 0;
12785 if (__pyx_t_35 < 0) {
12786 __pyx_t_35 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
12787 if (unlikely(__pyx_t_35 < 0)) __pyx_t_37 = 1;
12788 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_37 = 1;
12789 if (__pyx_t_36 < 0) {
12790 __pyx_t_36 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
12791 if (unlikely(__pyx_t_36 < 0)) __pyx_t_37 = 2;
12792 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_37 = 2;
12793 if (unlikely(__pyx_t_37 != -1)) {
12794 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12795 __PYX_ERR(0, 561, __pyx_L1_error)
12797 __pyx_t_38 = __pyx_v_eN;
12798 __pyx_t_39 = __pyx_v_ebN;
12800 if (__pyx_t_38 < 0) {
12801 __pyx_t_38 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
12802 if (unlikely(__pyx_t_38 < 0)) __pyx_t_37 = 0;
12803 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_37 = 0;
12804 if (__pyx_t_39 < 0) {
12805 __pyx_t_39 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
12806 if (unlikely(__pyx_t_39 < 0)) __pyx_t_37 = 1;
12807 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_37 = 1;
12808 if (unlikely(__pyx_t_37 != -1)) {
12809 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12810 __PYX_ERR(0, 561, __pyx_L1_error)
12812 __pyx_t_40 = __pyx_v_ii;
12814 if (__pyx_t_40 < 0) {
12815 __pyx_t_40 += __pyx_pybuffernd_a_up.diminfo[0].shape;
12816 if (unlikely(__pyx_t_40 < 0)) __pyx_t_37 = 0;
12817 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_37 = 0;
12818 if (unlikely(__pyx_t_37 != -1)) {
12819 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12820 __PYX_ERR(0, 561, __pyx_L1_error)
12822 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_a_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_36, __pyx_pybuffernd_q_alin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
12832 __pyx_t_31 = __pyx_v_nSpace;
12833 __pyx_t_32 = __pyx_t_31;
12834 for (__pyx_t_33 = 0; __pyx_t_33 < __pyx_t_32; __pyx_t_33+=1) {
12835 __pyx_v_I = __pyx_t_33;
12844 __pyx_t_41 = __pyx_v_eN;
12845 __pyx_t_42 = __pyx_v_ebN;
12846 __pyx_t_43 = __pyx_v_I;
12848 if (__pyx_t_41 < 0) {
12849 __pyx_t_41 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
12850 if (unlikely(__pyx_t_41 < 0)) __pyx_t_37 = 0;
12851 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_37 = 0;
12852 if (__pyx_t_42 < 0) {
12853 __pyx_t_42 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
12854 if (unlikely(__pyx_t_42 < 0)) __pyx_t_37 = 1;
12855 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_37 = 1;
12856 if (__pyx_t_43 < 0) {
12857 __pyx_t_43 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
12858 if (unlikely(__pyx_t_43 < 0)) __pyx_t_37 = 2;
12859 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_37 = 2;
12860 if (unlikely(__pyx_t_37 != -1)) {
12861 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12862 __PYX_ERR(0, 563, __pyx_L1_error)
12864 __pyx_t_44 = __pyx_v_eN;
12865 __pyx_t_45 = __pyx_v_ebN;
12867 if (__pyx_t_44 < 0) {
12868 __pyx_t_44 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
12869 if (unlikely(__pyx_t_44 < 0)) __pyx_t_37 = 0;
12870 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_37 = 0;
12871 if (__pyx_t_45 < 0) {
12872 __pyx_t_45 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
12873 if (unlikely(__pyx_t_45 < 0)) __pyx_t_37 = 1;
12874 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_37 = 1;
12875 if (unlikely(__pyx_t_37 != -1)) {
12876 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12877 __PYX_ERR(0, 563, __pyx_L1_error)
12879 __pyx_t_46 = __pyx_v_I;
12881 if (__pyx_t_46 < 0) {
12882 __pyx_t_46 += __pyx_pybuffernd_f_up.diminfo[0].shape;
12883 if (unlikely(__pyx_t_46 < 0)) __pyx_t_37 = 0;
12884 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_37 = 0;
12885 if (unlikely(__pyx_t_37 != -1)) {
12886 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12887 __PYX_ERR(0, 563, __pyx_L1_error)
12889 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_f_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_43, __pyx_pybuffernd_q_flin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
12899 __pyx_t_31 = __pyx_v_nSpace;
12900 __pyx_t_32 = __pyx_t_31;
12901 for (__pyx_t_33 = 0; __pyx_t_33 < __pyx_t_32; __pyx_t_33+=1) {
12902 __pyx_v_I = __pyx_t_33;
12911 __pyx_t_47 = __pyx_v_I;
12913 if (__pyx_t_47 < 0) {
12914 __pyx_t_47 += __pyx_pybuffernd_f_up.diminfo[0].shape;
12915 if (unlikely(__pyx_t_47 < 0)) __pyx_t_37 = 0;
12916 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_37 = 0;
12917 if (unlikely(__pyx_t_37 != -1)) {
12918 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12919 __PYX_ERR(0, 567, __pyx_L1_error)
12921 __pyx_t_48 = __pyx_v_eN;
12922 __pyx_t_49 = __pyx_v_ebN;
12923 __pyx_t_50 = __pyx_v_i;
12924 __pyx_t_51 = __pyx_v_I;
12926 if (__pyx_t_48 < 0) {
12927 __pyx_t_48 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
12928 if (unlikely(__pyx_t_48 < 0)) __pyx_t_37 = 0;
12929 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_37 = 0;
12930 if (__pyx_t_49 < 0) {
12931 __pyx_t_49 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
12932 if (unlikely(__pyx_t_49 < 0)) __pyx_t_37 = 1;
12933 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_37 = 1;
12934 if (__pyx_t_50 < 0) {
12935 __pyx_t_50 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
12936 if (unlikely(__pyx_t_50 < 0)) __pyx_t_37 = 2;
12937 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_37 = 2;
12938 if (__pyx_t_51 < 0) {
12939 __pyx_t_51 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
12940 if (unlikely(__pyx_t_51 < 0)) __pyx_t_37 = 3;
12941 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_37 = 3;
12942 if (unlikely(__pyx_t_37 != -1)) {
12943 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12944 __PYX_ERR(0, 567, __pyx_L1_error)
12946 __pyx_t_52 = __pyx_v_eN;
12947 __pyx_t_53 = __pyx_v_i;
12949 if (__pyx_t_52 < 0) {
12950 __pyx_t_52 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
12951 if (unlikely(__pyx_t_52 < 0)) __pyx_t_37 = 0;
12952 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_37 = 0;
12953 if (__pyx_t_53 < 0) {
12954 __pyx_t_53 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
12955 if (unlikely(__pyx_t_53 < 0)) __pyx_t_37 = 1;
12956 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_37 = 1;
12957 if (unlikely(__pyx_t_37 != -1)) {
12958 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12959 __PYX_ERR(0, 567, __pyx_L1_error)
12961 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_elementResidual.diminfo[1].strides) -= ((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_f_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_50, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_51, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
12970 __pyx_t_54 = (__pyx_v_I + 1);
12972 if (__pyx_t_54 < 0) {
12973 __pyx_t_54 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
12974 if (unlikely(__pyx_t_54 < 0)) __pyx_t_37 = 0;
12975 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_37 = 0;
12976 if (unlikely(__pyx_t_37 != -1)) {
12977 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12978 __PYX_ERR(0, 568, __pyx_L1_error)
12980 __pyx_t_55 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_rowptr.diminfo[0].strides));
12981 __pyx_t_56 = __pyx_v_I;
12983 if (__pyx_t_56 < 0) {
12984 __pyx_t_56 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
12985 if (unlikely(__pyx_t_56 < 0)) __pyx_t_37 = 0;
12986 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_37 = 0;
12987 if (unlikely(__pyx_t_37 != -1)) {
12988 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12989 __PYX_ERR(0, 568, __pyx_L1_error)
12991 __pyx_t_57 = __pyx_t_55;
12992 for (__pyx_t_37 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_37 < __pyx_t_57; __pyx_t_37+=1) {
12993 __pyx_v_ii = __pyx_t_37;
13002 __pyx_t_58 = __pyx_v_ii;
13004 if (__pyx_t_58 < 0) {
13005 __pyx_t_58 += __pyx_pybuffernd_a_up.diminfo[0].shape;
13006 if (unlikely(__pyx_t_58 < 0)) __pyx_t_59 = 0;
13007 }
else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_59 = 0;
13008 if (unlikely(__pyx_t_59 != -1)) {
13009 __Pyx_RaiseBufferIndexError(__pyx_t_59);
13010 __PYX_ERR(0, 569, __pyx_L1_error)
13012 __pyx_t_60 = __pyx_v_ii;
13014 if (__pyx_t_60 < 0) {
13015 __pyx_t_60 += __pyx_pybuffernd_colind.diminfo[0].shape;
13016 if (unlikely(__pyx_t_60 < 0)) __pyx_t_59 = 0;
13017 }
else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_59 = 0;
13018 if (unlikely(__pyx_t_59 != -1)) {
13019 __Pyx_RaiseBufferIndexError(__pyx_t_59);
13020 __PYX_ERR(0, 569, __pyx_L1_error)
13022 __pyx_t_61 = __pyx_v_eN;
13023 __pyx_t_62 = __pyx_v_ebN;
13024 __pyx_t_63 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd_colind.diminfo[0].strides));
13026 if (__pyx_t_61 < 0) {
13027 __pyx_t_61 += __pyx_pybuffernd_q_grad_u.diminfo[0].shape;
13028 if (unlikely(__pyx_t_61 < 0)) __pyx_t_59 = 0;
13029 }
else if (unlikely(__pyx_t_61 >= __pyx_pybuffernd_q_grad_u.diminfo[0].shape)) __pyx_t_59 = 0;
13030 if (__pyx_t_62 < 0) {
13031 __pyx_t_62 += __pyx_pybuffernd_q_grad_u.diminfo[1].shape;
13032 if (unlikely(__pyx_t_62 < 0)) __pyx_t_59 = 1;
13033 }
else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_q_grad_u.diminfo[1].shape)) __pyx_t_59 = 1;
13034 if (__pyx_t_63 < 0) {
13035 __pyx_t_63 += __pyx_pybuffernd_q_grad_u.diminfo[2].shape;
13036 if (unlikely(__pyx_t_63 < 0)) __pyx_t_59 = 2;
13037 }
else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd_q_grad_u.diminfo[2].shape)) __pyx_t_59 = 2;
13038 if (unlikely(__pyx_t_59 != -1)) {
13039 __Pyx_RaiseBufferIndexError(__pyx_t_59);
13040 __PYX_ERR(0, 569, __pyx_L1_error)
13042 __pyx_t_64 = __pyx_v_eN;
13043 __pyx_t_65 = __pyx_v_ebN;
13044 __pyx_t_66 = __pyx_v_i;
13045 __pyx_t_67 = __pyx_v_I;
13047 if (__pyx_t_64 < 0) {
13048 __pyx_t_64 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
13049 if (unlikely(__pyx_t_64 < 0)) __pyx_t_59 = 0;
13050 }
else if (unlikely(__pyx_t_64 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_59 = 0;
13051 if (__pyx_t_65 < 0) {
13052 __pyx_t_65 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
13053 if (unlikely(__pyx_t_65 < 0)) __pyx_t_59 = 1;
13054 }
else if (unlikely(__pyx_t_65 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_59 = 1;
13055 if (__pyx_t_66 < 0) {
13056 __pyx_t_66 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
13057 if (unlikely(__pyx_t_66 < 0)) __pyx_t_59 = 2;
13058 }
else if (unlikely(__pyx_t_66 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_59 = 2;
13059 if (__pyx_t_67 < 0) {
13060 __pyx_t_67 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
13061 if (unlikely(__pyx_t_67 < 0)) __pyx_t_59 = 3;
13062 }
else if (unlikely(__pyx_t_67 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_59 = 3;
13063 if (unlikely(__pyx_t_59 != -1)) {
13064 __Pyx_RaiseBufferIndexError(__pyx_t_59);
13065 __PYX_ERR(0, 569, __pyx_L1_error)
13067 __pyx_t_68 = __pyx_v_eN;
13068 __pyx_t_69 = __pyx_v_i;
13070 if (__pyx_t_68 < 0) {
13071 __pyx_t_68 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
13072 if (unlikely(__pyx_t_68 < 0)) __pyx_t_59 = 0;
13073 }
else if (unlikely(__pyx_t_68 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_59 = 0;
13074 if (__pyx_t_69 < 0) {
13075 __pyx_t_69 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
13076 if (unlikely(__pyx_t_69 < 0)) __pyx_t_59 = 1;
13077 }
else if (unlikely(__pyx_t_69 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_59 = 1;
13078 if (unlikely(__pyx_t_59 != -1)) {
13079 __Pyx_RaiseBufferIndexError(__pyx_t_59);
13080 __PYX_ERR(0, 569, __pyx_L1_error)
13082 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_68, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_69, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_a_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.buf, __pyx_t_61, __pyx_pybuffernd_q_grad_u.diminfo[0].strides, __pyx_t_62, __pyx_pybuffernd_q_grad_u.diminfo[1].strides, __pyx_t_63, __pyx_pybuffernd_q_grad_u.diminfo[2].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_64, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_65, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_66, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_67, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
13098 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13101 __Pyx_XDECREF(__pyx_t_1);
13102 __Pyx_XDECREF(__pyx_t_2);
13103 __Pyx_XDECREF(__pyx_t_4);
13104 __Pyx_XDECREF(__pyx_t_5);
13105 __Pyx_XDECREF(__pyx_t_9);
13106 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
13107 __Pyx_PyThreadState_declare
13108 __Pyx_PyThreadState_assign
13109 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
13110 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
13111 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
13112 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
13113 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
13114 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer);
13115 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
13116 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
13117 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
13118 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
13119 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
13120 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
13121 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
13122 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
13123 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
13124 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
13125 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
13126 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
13127 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
13128 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
13129 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
13130 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementResidual", __pyx_clineno, __pyx_lineno, __pyx_filename);
13134 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
13135 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
13136 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
13137 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
13138 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer);
13139 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
13140 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
13141 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
13142 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
13143 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
13144 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
13145 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
13146 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
13147 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
13148 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
13149 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
13150 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
13151 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
13152 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
13154 __Pyx_XDECREF(__pyx_v_q);
13155 __Pyx_XDECREF((PyObject *)__pyx_v_a_up);
13156 __Pyx_XDECREF((PyObject *)__pyx_v_f_up);
13157 __Pyx_XGIVEREF(__pyx_r);
13158 __Pyx_RefNannyFinishContext();
13171 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13172 static char __pyx_doc_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian[] =
"\n residual routine for NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n upwinds relative permeability based on element averages\n applies dirichlet boundary conditions strongly but keeps dofs in system\n\n TODO:\n everything\n \n ";
13173 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian = {
"RE_NCP1_getElementJacobian", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian};
13174 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13175 CYTHON_UNUSED PyArrayObject *__pyx_v_gravity = 0;
13176 PyArrayObject *__pyx_v_rowptr = 0;
13177 PyArrayObject *__pyx_v_colind = 0;
13178 int __pyx_v_nSpace;
13179 int __pyx_v_nElements_global;
13180 int __pyx_v_nElementBoundaries_element;
13181 CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray = 0;
13182 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray = 0;
13183 int __pyx_v_nDOF_test_element;
13184 int __pyx_v_nDOF_trial_element;
13185 PyArrayObject *__pyx_v_q_u = 0;
13186 CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u = 0;
13187 PyArrayObject *__pyx_v_q_grad_w = 0;
13188 PyArrayObject *__pyx_v_q_grad_v = 0;
13189 PyArrayObject *__pyx_v_q_detJ = 0;
13190 PyArrayObject *__pyx_v_q_m = 0;
13191 CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm = 0;
13192 PyArrayObject *__pyx_v_q_mt = 0;
13193 PyArrayObject *__pyx_v_q_dmt = 0;
13194 PyArrayObject *__pyx_v_q_r = 0;
13195 PyArrayObject *__pyx_v_q_kr = 0;
13196 CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr = 0;
13197 PyArrayObject *__pyx_v_q_kr_up = 0;
13198 PyArrayObject *__pyx_v_q_flin = 0;
13199 PyArrayObject *__pyx_v_q_alin = 0;
13200 PyArrayObject *__pyx_v_elementJacobian = 0;
13201 PyObject *__pyx_r = 0;
13202 __Pyx_RefNannyDeclarations
13203 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementJacobian (wrapper)", 0);
13205 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_nDOF_test_element,&__pyx_n_s_nDOF_trial_element,&__pyx_n_s_q_u,&__pyx_n_s_q_grad_u,&__pyx_n_s_q_grad_w,&__pyx_n_s_q_grad_v,&__pyx_n_s_q_detJ,&__pyx_n_s_q_m,&__pyx_n_s_q_dm,&__pyx_n_s_q_mt,&__pyx_n_s_q_dmt,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_dkr,&__pyx_n_s_q_kr_up,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,&__pyx_n_s_elementJacobian,0};
13206 PyObject* values[26] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
13207 if (unlikely(__pyx_kwds)) {
13208 Py_ssize_t kw_args;
13209 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13210 switch (pos_args) {
13211 case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
13212 CYTHON_FALLTHROUGH;
13213 case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
13214 CYTHON_FALLTHROUGH;
13215 case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
13216 CYTHON_FALLTHROUGH;
13217 case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
13218 CYTHON_FALLTHROUGH;
13219 case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
13220 CYTHON_FALLTHROUGH;
13221 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
13222 CYTHON_FALLTHROUGH;
13223 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
13224 CYTHON_FALLTHROUGH;
13225 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
13226 CYTHON_FALLTHROUGH;
13227 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
13228 CYTHON_FALLTHROUGH;
13229 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
13230 CYTHON_FALLTHROUGH;
13231 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
13232 CYTHON_FALLTHROUGH;
13233 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
13234 CYTHON_FALLTHROUGH;
13235 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
13236 CYTHON_FALLTHROUGH;
13237 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
13238 CYTHON_FALLTHROUGH;
13239 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
13240 CYTHON_FALLTHROUGH;
13241 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
13242 CYTHON_FALLTHROUGH;
13243 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
13244 CYTHON_FALLTHROUGH;
13245 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
13246 CYTHON_FALLTHROUGH;
13247 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
13248 CYTHON_FALLTHROUGH;
13249 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
13250 CYTHON_FALLTHROUGH;
13251 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
13252 CYTHON_FALLTHROUGH;
13253 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
13254 CYTHON_FALLTHROUGH;
13255 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13256 CYTHON_FALLTHROUGH;
13257 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13258 CYTHON_FALLTHROUGH;
13259 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13260 CYTHON_FALLTHROUGH;
13261 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13262 CYTHON_FALLTHROUGH;
13264 default:
goto __pyx_L5_argtuple_error;
13266 kw_args = PyDict_Size(__pyx_kwds);
13267 switch (pos_args) {
13269 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
13270 else goto __pyx_L5_argtuple_error;
13271 CYTHON_FALLTHROUGH;
13273 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
13275 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 1); __PYX_ERR(0, 574, __pyx_L3_error)
13277 CYTHON_FALLTHROUGH;
13279 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
13281 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 2); __PYX_ERR(0, 574, __pyx_L3_error)
13283 CYTHON_FALLTHROUGH;
13285 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
13287 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 3); __PYX_ERR(0, 574, __pyx_L3_error)
13289 CYTHON_FALLTHROUGH;
13291 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
13293 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 4); __PYX_ERR(0, 574, __pyx_L3_error)
13295 CYTHON_FALLTHROUGH;
13297 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
13299 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 5); __PYX_ERR(0, 574, __pyx_L3_error)
13301 CYTHON_FALLTHROUGH;
13303 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
13305 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 6); __PYX_ERR(0, 574, __pyx_L3_error)
13307 CYTHON_FALLTHROUGH;
13309 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
13311 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 7); __PYX_ERR(0, 574, __pyx_L3_error)
13313 CYTHON_FALLTHROUGH;
13315 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_test_element)) != 0)) kw_args--;
13317 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 8); __PYX_ERR(0, 574, __pyx_L3_error)
13319 CYTHON_FALLTHROUGH;
13321 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_trial_element)) != 0)) kw_args--;
13323 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 9); __PYX_ERR(0, 574, __pyx_L3_error)
13325 CYTHON_FALLTHROUGH;
13327 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
13329 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 10); __PYX_ERR(0, 574, __pyx_L3_error)
13331 CYTHON_FALLTHROUGH;
13333 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_u)) != 0)) kw_args--;
13335 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 11); __PYX_ERR(0, 574, __pyx_L3_error)
13337 CYTHON_FALLTHROUGH;
13339 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_w)) != 0)) kw_args--;
13341 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 12); __PYX_ERR(0, 574, __pyx_L3_error)
13343 CYTHON_FALLTHROUGH;
13345 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_v)) != 0)) kw_args--;
13347 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 13); __PYX_ERR(0, 574, __pyx_L3_error)
13349 CYTHON_FALLTHROUGH;
13351 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_detJ)) != 0)) kw_args--;
13353 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 14); __PYX_ERR(0, 574, __pyx_L3_error)
13355 CYTHON_FALLTHROUGH;
13357 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_m)) != 0)) kw_args--;
13359 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 15); __PYX_ERR(0, 574, __pyx_L3_error)
13361 CYTHON_FALLTHROUGH;
13363 if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dm)) != 0)) kw_args--;
13365 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 16); __PYX_ERR(0, 574, __pyx_L3_error)
13367 CYTHON_FALLTHROUGH;
13369 if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_mt)) != 0)) kw_args--;
13371 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 17); __PYX_ERR(0, 574, __pyx_L3_error)
13373 CYTHON_FALLTHROUGH;
13375 if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dmt)) != 0)) kw_args--;
13377 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 18); __PYX_ERR(0, 574, __pyx_L3_error)
13379 CYTHON_FALLTHROUGH;
13381 if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
13383 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 19); __PYX_ERR(0, 574, __pyx_L3_error)
13385 CYTHON_FALLTHROUGH;
13387 if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
13389 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 20); __PYX_ERR(0, 574, __pyx_L3_error)
13391 CYTHON_FALLTHROUGH;
13393 if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dkr)) != 0)) kw_args--;
13395 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 21); __PYX_ERR(0, 574, __pyx_L3_error)
13397 CYTHON_FALLTHROUGH;
13399 if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
13401 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 22); __PYX_ERR(0, 574, __pyx_L3_error)
13403 CYTHON_FALLTHROUGH;
13405 if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
13407 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 23); __PYX_ERR(0, 574, __pyx_L3_error)
13409 CYTHON_FALLTHROUGH;
13411 if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
13413 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 24); __PYX_ERR(0, 574, __pyx_L3_error)
13415 CYTHON_FALLTHROUGH;
13417 if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementJacobian)) != 0)) kw_args--;
13419 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 25); __PYX_ERR(0, 574, __pyx_L3_error)
13422 if (unlikely(kw_args > 0)) {
13423 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_getElementJacobian") < 0)) __PYX_ERR(0, 574, __pyx_L3_error)
13425 }
else if (PyTuple_GET_SIZE(__pyx_args) != 26) {
13426 goto __pyx_L5_argtuple_error;
13428 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13429 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13430 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13431 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13432 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
13433 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
13434 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
13435 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
13436 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
13437 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
13438 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
13439 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
13440 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
13441 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
13442 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
13443 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
13444 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
13445 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
13446 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
13447 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
13448 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
13449 values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
13450 values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
13451 values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
13452 values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
13453 values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
13455 __pyx_v_gravity = ((PyArrayObject *)values[0]);
13456 __pyx_v_rowptr = ((PyArrayObject *)values[1]);
13457 __pyx_v_colind = ((PyArrayObject *)values[2]);
13458 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L3_error)
13459 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 579, __pyx_L3_error)
13460 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error)
13461 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[6]);
13462 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[7]);
13463 __pyx_v_nDOF_test_element = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nDOF_test_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error)
13464 __pyx_v_nDOF_trial_element = __Pyx_PyInt_As_int(values[9]);
if (unlikely((__pyx_v_nDOF_trial_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error)
13465 __pyx_v_q_u = ((PyArrayObject *)values[10]);
13466 __pyx_v_q_grad_u = ((PyArrayObject *)values[11]);
13467 __pyx_v_q_grad_w = ((PyArrayObject *)values[12]);
13468 __pyx_v_q_grad_v = ((PyArrayObject *)values[13]);
13469 __pyx_v_q_detJ = ((PyArrayObject *)values[14]);
13470 __pyx_v_q_m = ((PyArrayObject *)values[15]);
13471 __pyx_v_q_dm = ((PyArrayObject *)values[16]);
13472 __pyx_v_q_mt = ((PyArrayObject *)values[17]);
13473 __pyx_v_q_dmt = ((PyArrayObject *)values[18]);
13474 __pyx_v_q_r = ((PyArrayObject *)values[19]);
13475 __pyx_v_q_kr = ((PyArrayObject *)values[20]);
13476 __pyx_v_q_dkr = ((PyArrayObject *)values[21]);
13477 __pyx_v_q_kr_up = ((PyArrayObject *)values[22]);
13478 __pyx_v_q_flin = ((PyArrayObject *)values[23]);
13479 __pyx_v_q_alin = ((PyArrayObject *)values[24]);
13480 __pyx_v_elementJacobian = ((PyArrayObject *)values[25]);
13482 goto __pyx_L4_argument_unpacking_done;
13483 __pyx_L5_argtuple_error:;
13484 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 574, __pyx_L3_error)
13486 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
13487 __Pyx_RefNannyFinishContext();
13489 __pyx_L4_argument_unpacking_done:;
13490 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 574, __pyx_L1_error)
13491 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 575, __pyx_L1_error)
13492 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 576, __pyx_L1_error)
13493 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 581, __pyx_L1_error)
13494 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 582, __pyx_L1_error)
13495 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 586, __pyx_L1_error)
13496 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_u), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_u", 0))) __PYX_ERR(0, 587, __pyx_L1_error)
13497 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_w), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_w", 0))) __PYX_ERR(0, 588, __pyx_L1_error)
13498 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_v), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_v", 0))) __PYX_ERR(0, 589, __pyx_L1_error)
13499 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_detJ), __pyx_ptype_5numpy_ndarray, 1,
"q_detJ", 0))) __PYX_ERR(0, 591, __pyx_L1_error)
13500 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_m), __pyx_ptype_5numpy_ndarray, 1,
"q_m", 0))) __PYX_ERR(0, 592, __pyx_L1_error)
13501 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dm), __pyx_ptype_5numpy_ndarray, 1,
"q_dm", 0))) __PYX_ERR(0, 593, __pyx_L1_error)
13502 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mt), __pyx_ptype_5numpy_ndarray, 1,
"q_mt", 0))) __PYX_ERR(0, 594, __pyx_L1_error)
13503 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dmt), __pyx_ptype_5numpy_ndarray, 1,
"q_dmt", 0))) __PYX_ERR(0, 595, __pyx_L1_error)
13504 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) __PYX_ERR(0, 596, __pyx_L1_error)
13505 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) __PYX_ERR(0, 597, __pyx_L1_error)
13506 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dkr), __pyx_ptype_5numpy_ndarray, 1,
"q_dkr", 0))) __PYX_ERR(0, 598, __pyx_L1_error)
13507 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) __PYX_ERR(0, 599, __pyx_L1_error)
13508 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) __PYX_ERR(0, 602, __pyx_L1_error)
13509 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) __PYX_ERR(0, 603, __pyx_L1_error)
13510 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementJacobian), __pyx_ptype_5numpy_ndarray, 1,
"elementJacobian", 0))) __PYX_ERR(0, 605, __pyx_L1_error)
13511 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(__pyx_self, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, __pyx_v_q_u, __pyx_v_q_grad_u, __pyx_v_q_grad_w, __pyx_v_q_grad_v, __pyx_v_q_detJ, __pyx_v_q_m, __pyx_v_q_dm, __pyx_v_q_mt, __pyx_v_q_dmt, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_dkr, __pyx_v_q_kr_up, __pyx_v_q_flin, __pyx_v_q_alin, __pyx_v_elementJacobian);
13518 __Pyx_RefNannyFinishContext();
13522 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_q_u, CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_grad_v, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_dmt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementJacobian) {
13523 CYTHON_UNUSED
int __pyx_v_upwindFlag;
13524 CYTHON_UNUSED
int __pyx_v_picard;
13525 PyObject *__pyx_v_q = NULL;
13530 PyArrayObject *__pyx_v_a_up = 0;
13531 PyArrayObject *__pyx_v_f_up = 0;
13532 double __pyx_v_nAvgWeight;
13533 double __pyx_v_weight;
13534 double __pyx_v_volFactor;
13535 CYTHON_UNUSED
int __pyx_v_thisElementIsUpwind;
13536 double __pyx_v_volume;
13540 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_up;
13541 __Pyx_Buffer __pyx_pybuffer_a_up;
13542 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
13543 __Pyx_Buffer __pyx_pybuffer_colind;
13544 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
13545 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
13546 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementJacobian;
13547 __Pyx_Buffer __pyx_pybuffer_elementJacobian;
13548 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
13549 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
13550 __Pyx_LocalBuf_ND __pyx_pybuffernd_f_up;
13551 __Pyx_Buffer __pyx_pybuffer_f_up;
13552 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
13553 __Pyx_Buffer __pyx_pybuffer_gravity;
13554 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
13555 __Pyx_Buffer __pyx_pybuffer_q_alin;
13556 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_detJ;
13557 __Pyx_Buffer __pyx_pybuffer_q_detJ;
13558 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dkr;
13559 __Pyx_Buffer __pyx_pybuffer_q_dkr;
13560 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dm;
13561 __Pyx_Buffer __pyx_pybuffer_q_dm;
13562 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dmt;
13563 __Pyx_Buffer __pyx_pybuffer_q_dmt;
13564 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
13565 __Pyx_Buffer __pyx_pybuffer_q_flin;
13566 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_u;
13567 __Pyx_Buffer __pyx_pybuffer_q_grad_u;
13568 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_v;
13569 __Pyx_Buffer __pyx_pybuffer_q_grad_v;
13570 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_w;
13571 __Pyx_Buffer __pyx_pybuffer_q_grad_w;
13572 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
13573 __Pyx_Buffer __pyx_pybuffer_q_kr;
13574 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
13575 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
13576 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_m;
13577 __Pyx_Buffer __pyx_pybuffer_q_m;
13578 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mt;
13579 __Pyx_Buffer __pyx_pybuffer_q_mt;
13580 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
13581 __Pyx_Buffer __pyx_pybuffer_q_r;
13582 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
13583 __Pyx_Buffer __pyx_pybuffer_q_u;
13584 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
13585 __Pyx_Buffer __pyx_pybuffer_rowptr;
13586 PyObject *__pyx_r = NULL;
13587 __Pyx_RefNannyDeclarations
13588 PyObject *__pyx_t_1 = NULL;
13589 PyObject *__pyx_t_2 = NULL;
13590 Py_ssize_t __pyx_t_3;
13591 PyObject *__pyx_t_4 = NULL;
13592 PyObject *__pyx_t_5 = NULL;
13594 Py_ssize_t __pyx_t_7;
13596 PyObject *__pyx_t_9 = NULL;
13597 PyArrayObject *__pyx_t_10 = NULL;
13598 PyArrayObject *__pyx_t_11 = NULL;
13602 Py_ssize_t __pyx_t_15;
13603 Py_ssize_t __pyx_t_16;
13607 Py_ssize_t __pyx_t_20;
13608 Py_ssize_t __pyx_t_21;
13610 Py_ssize_t __pyx_t_23;
13611 Py_ssize_t __pyx_t_24;
13612 Py_ssize_t __pyx_t_25;
13618 Py_ssize_t __pyx_t_31;
13619 Py_ssize_t __pyx_t_32;
13620 Py_ssize_t __pyx_t_33;
13622 Py_ssize_t __pyx_t_35;
13623 Py_ssize_t __pyx_t_36;
13624 Py_ssize_t __pyx_t_37;
13625 Py_ssize_t __pyx_t_38;
13626 Py_ssize_t __pyx_t_39;
13627 Py_ssize_t __pyx_t_40;
13628 Py_ssize_t __pyx_t_41;
13629 Py_ssize_t __pyx_t_42;
13630 Py_ssize_t __pyx_t_43;
13633 Py_ssize_t __pyx_t_46;
13635 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_48;
13636 Py_ssize_t __pyx_t_49;
13637 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_50;
13638 Py_ssize_t __pyx_t_51;
13640 Py_ssize_t __pyx_t_53;
13641 Py_ssize_t __pyx_t_54;
13642 Py_ssize_t __pyx_t_55;
13643 Py_ssize_t __pyx_t_56;
13644 Py_ssize_t __pyx_t_57;
13645 Py_ssize_t __pyx_t_58;
13646 Py_ssize_t __pyx_t_59;
13647 Py_ssize_t __pyx_t_60;
13648 Py_ssize_t __pyx_t_61;
13649 Py_ssize_t __pyx_t_62;
13650 Py_ssize_t __pyx_t_63;
13651 Py_ssize_t __pyx_t_64;
13652 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementJacobian", 0);
13653 __pyx_pybuffer_a_up.pybuffer.buf = NULL;
13654 __pyx_pybuffer_a_up.refcount = 0;
13655 __pyx_pybuffernd_a_up.data = NULL;
13656 __pyx_pybuffernd_a_up.rcbuffer = &__pyx_pybuffer_a_up;
13657 __pyx_pybuffer_f_up.pybuffer.buf = NULL;
13658 __pyx_pybuffer_f_up.refcount = 0;
13659 __pyx_pybuffernd_f_up.data = NULL;
13660 __pyx_pybuffernd_f_up.rcbuffer = &__pyx_pybuffer_f_up;
13661 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
13662 __pyx_pybuffer_gravity.refcount = 0;
13663 __pyx_pybuffernd_gravity.data = NULL;
13664 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
13665 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
13666 __pyx_pybuffer_rowptr.refcount = 0;
13667 __pyx_pybuffernd_rowptr.data = NULL;
13668 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
13669 __pyx_pybuffer_colind.pybuffer.buf = NULL;
13670 __pyx_pybuffer_colind.refcount = 0;
13671 __pyx_pybuffernd_colind.data = NULL;
13672 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
13673 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
13674 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
13675 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
13676 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
13677 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
13678 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
13679 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
13680 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
13681 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
13682 __pyx_pybuffer_q_u.refcount = 0;
13683 __pyx_pybuffernd_q_u.data = NULL;
13684 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
13685 __pyx_pybuffer_q_grad_u.pybuffer.buf = NULL;
13686 __pyx_pybuffer_q_grad_u.refcount = 0;
13687 __pyx_pybuffernd_q_grad_u.data = NULL;
13688 __pyx_pybuffernd_q_grad_u.rcbuffer = &__pyx_pybuffer_q_grad_u;
13689 __pyx_pybuffer_q_grad_w.pybuffer.buf = NULL;
13690 __pyx_pybuffer_q_grad_w.refcount = 0;
13691 __pyx_pybuffernd_q_grad_w.data = NULL;
13692 __pyx_pybuffernd_q_grad_w.rcbuffer = &__pyx_pybuffer_q_grad_w;
13693 __pyx_pybuffer_q_grad_v.pybuffer.buf = NULL;
13694 __pyx_pybuffer_q_grad_v.refcount = 0;
13695 __pyx_pybuffernd_q_grad_v.data = NULL;
13696 __pyx_pybuffernd_q_grad_v.rcbuffer = &__pyx_pybuffer_q_grad_v;
13697 __pyx_pybuffer_q_detJ.pybuffer.buf = NULL;
13698 __pyx_pybuffer_q_detJ.refcount = 0;
13699 __pyx_pybuffernd_q_detJ.data = NULL;
13700 __pyx_pybuffernd_q_detJ.rcbuffer = &__pyx_pybuffer_q_detJ;
13701 __pyx_pybuffer_q_m.pybuffer.buf = NULL;
13702 __pyx_pybuffer_q_m.refcount = 0;
13703 __pyx_pybuffernd_q_m.data = NULL;
13704 __pyx_pybuffernd_q_m.rcbuffer = &__pyx_pybuffer_q_m;
13705 __pyx_pybuffer_q_dm.pybuffer.buf = NULL;
13706 __pyx_pybuffer_q_dm.refcount = 0;
13707 __pyx_pybuffernd_q_dm.data = NULL;
13708 __pyx_pybuffernd_q_dm.rcbuffer = &__pyx_pybuffer_q_dm;
13709 __pyx_pybuffer_q_mt.pybuffer.buf = NULL;
13710 __pyx_pybuffer_q_mt.refcount = 0;
13711 __pyx_pybuffernd_q_mt.data = NULL;
13712 __pyx_pybuffernd_q_mt.rcbuffer = &__pyx_pybuffer_q_mt;
13713 __pyx_pybuffer_q_dmt.pybuffer.buf = NULL;
13714 __pyx_pybuffer_q_dmt.refcount = 0;
13715 __pyx_pybuffernd_q_dmt.data = NULL;
13716 __pyx_pybuffernd_q_dmt.rcbuffer = &__pyx_pybuffer_q_dmt;
13717 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
13718 __pyx_pybuffer_q_r.refcount = 0;
13719 __pyx_pybuffernd_q_r.data = NULL;
13720 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
13721 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
13722 __pyx_pybuffer_q_kr.refcount = 0;
13723 __pyx_pybuffernd_q_kr.data = NULL;
13724 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
13725 __pyx_pybuffer_q_dkr.pybuffer.buf = NULL;
13726 __pyx_pybuffer_q_dkr.refcount = 0;
13727 __pyx_pybuffernd_q_dkr.data = NULL;
13728 __pyx_pybuffernd_q_dkr.rcbuffer = &__pyx_pybuffer_q_dkr;
13729 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
13730 __pyx_pybuffer_q_kr_up.refcount = 0;
13731 __pyx_pybuffernd_q_kr_up.data = NULL;
13732 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
13733 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
13734 __pyx_pybuffer_q_flin.refcount = 0;
13735 __pyx_pybuffernd_q_flin.data = NULL;
13736 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
13737 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
13738 __pyx_pybuffer_q_alin.refcount = 0;
13739 __pyx_pybuffernd_q_alin.data = NULL;
13740 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
13741 __pyx_pybuffer_elementJacobian.pybuffer.buf = NULL;
13742 __pyx_pybuffer_elementJacobian.refcount = 0;
13743 __pyx_pybuffernd_elementJacobian.data = NULL;
13744 __pyx_pybuffernd_elementJacobian.rcbuffer = &__pyx_pybuffer_elementJacobian;
13746 __Pyx_BufFmt_StackElem __pyx_stack[1];
13747 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13749 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
13751 __Pyx_BufFmt_StackElem __pyx_stack[1];
13752 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13754 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
13756 __Pyx_BufFmt_StackElem __pyx_stack[1];
13757 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13759 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
13761 __Pyx_BufFmt_StackElem __pyx_stack[1];
13762 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13764 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
13766 __Pyx_BufFmt_StackElem __pyx_stack[1];
13767 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13769 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
13771 __Pyx_BufFmt_StackElem __pyx_stack[1];
13772 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13774 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
13776 __Pyx_BufFmt_StackElem __pyx_stack[1];
13777 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13779 __pyx_pybuffernd_q_grad_u.diminfo[0].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_u.diminfo[0].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_u.diminfo[1].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_u.diminfo[1].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_u.diminfo[2].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_u.diminfo[2].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[2];
13781 __Pyx_BufFmt_StackElem __pyx_stack[1];
13782 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13784 __pyx_pybuffernd_q_grad_w.diminfo[0].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_w.diminfo[0].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_w.diminfo[1].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_w.diminfo[1].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_w.diminfo[2].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_w.diminfo[2].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_w.diminfo[3].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_w.diminfo[3].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[3];
13786 __Pyx_BufFmt_StackElem __pyx_stack[1];
13787 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13789 __pyx_pybuffernd_q_grad_v.diminfo[0].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_v.diminfo[0].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_v.diminfo[1].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_v.diminfo[1].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_v.diminfo[2].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_v.diminfo[2].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_v.diminfo[3].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_v.diminfo[3].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[3];
13791 __Pyx_BufFmt_StackElem __pyx_stack[1];
13792 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_detJ, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13794 __pyx_pybuffernd_q_detJ.diminfo[0].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_detJ.diminfo[0].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_detJ.diminfo[1].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_detJ.diminfo[1].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[1];
13796 __Pyx_BufFmt_StackElem __pyx_stack[1];
13797 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_m, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13799 __pyx_pybuffernd_q_m.diminfo[0].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_m.diminfo[0].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_m.diminfo[1].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_m.diminfo[1].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[1];
13801 __Pyx_BufFmt_StackElem __pyx_stack[1];
13802 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13804 __pyx_pybuffernd_q_dm.diminfo[0].strides = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dm.diminfo[0].shape = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dm.diminfo[1].strides = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dm.diminfo[1].shape = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.shape[1];
13806 __Pyx_BufFmt_StackElem __pyx_stack[1];
13807 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13809 __pyx_pybuffernd_q_mt.diminfo[0].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mt.diminfo[0].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mt.diminfo[1].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mt.diminfo[1].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[1];
13811 __Pyx_BufFmt_StackElem __pyx_stack[1];
13812 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dmt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13814 __pyx_pybuffernd_q_dmt.diminfo[0].strides = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dmt.diminfo[0].shape = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dmt.diminfo[1].strides = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dmt.diminfo[1].shape = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.shape[1];
13816 __Pyx_BufFmt_StackElem __pyx_stack[1];
13817 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13819 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
13821 __Pyx_BufFmt_StackElem __pyx_stack[1];
13822 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13824 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
13826 __Pyx_BufFmt_StackElem __pyx_stack[1];
13827 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dkr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13829 __pyx_pybuffernd_q_dkr.diminfo[0].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dkr.diminfo[0].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dkr.diminfo[1].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dkr.diminfo[1].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[1];
13831 __Pyx_BufFmt_StackElem __pyx_stack[1];
13832 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13834 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
13836 __Pyx_BufFmt_StackElem __pyx_stack[1];
13837 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13839 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
13841 __Pyx_BufFmt_StackElem __pyx_stack[1];
13842 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13844 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
13846 __Pyx_BufFmt_StackElem __pyx_stack[1];
13847 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementJacobian, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13849 __pyx_pybuffernd_elementJacobian.diminfo[0].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementJacobian.diminfo[0].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementJacobian.diminfo[1].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementJacobian.diminfo[1].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_elementJacobian.diminfo[2].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_elementJacobian.diminfo[2].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[2];
13858 __pyx_v_upwindFlag = 1;
13867 __pyx_v_picard = 1;
13876 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
13877 __Pyx_GOTREF(__pyx_t_1);
13878 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
13879 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
13880 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
13881 __Pyx_INCREF(((PyObject *)__pyx_v_q_m));
13882 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_m));
13883 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_m));
13884 __Pyx_INCREF(((PyObject *)__pyx_v_q_mt));
13885 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mt));
13886 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_mt));
13887 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
13888 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
13889 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_r));
13890 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
13891 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
13892 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_kr));
13893 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
13894 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13896 if (__pyx_t_3 >= 5)
break;
13897 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 13898 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 623, __pyx_L1_error)
13900 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
13901 __Pyx_GOTREF(__pyx_t_1);
13903 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
13913 #ifndef CYTHON_WITHOUT_ASSERTIONS 13914 if (unlikely(!Py_OptimizeFlag)) {
13915 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
13916 __Pyx_GOTREF(__pyx_t_1);
13917 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 624, __pyx_L1_error)
13918 __Pyx_GOTREF(__pyx_t_4);
13919 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13920 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
13921 __Pyx_GOTREF(__pyx_t_1);
13922 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 624, __pyx_L1_error)
13923 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13924 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13925 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 624, __pyx_L1_error)
13926 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13927 if (unlikely(!__pyx_t_6)) {
13928 PyErr_SetNone(PyExc_AssertionError);
13929 __PYX_ERR(0, 624, __pyx_L1_error)
13942 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13951 #ifndef CYTHON_WITHOUT_ASSERTIONS 13952 if (unlikely(!Py_OptimizeFlag)) {
13953 if (unlikely(!((__pyx_v_nDOF_test_element == (__pyx_v_nSpace + 1)) != 0))) {
13954 PyErr_SetNone(PyExc_AssertionError);
13955 __PYX_ERR(0, 625, __pyx_L1_error)
13967 __pyx_t_7 = __pyx_v_nSpace;
13969 if (__pyx_t_7 < 0) {
13970 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
13971 if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
13972 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_8 = 0;
13973 if (unlikely(__pyx_t_8 != -1)) {
13974 __Pyx_RaiseBufferIndexError(__pyx_t_8);
13975 __PYX_ERR(0, 626, __pyx_L1_error)
13977 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides));
13986 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error)
13987 __Pyx_GOTREF(__pyx_t_5);
13988 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error)
13989 __Pyx_GOTREF(__pyx_t_1);
13990 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13991 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error)
13992 __Pyx_GOTREF(__pyx_t_5);
13995 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
13996 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
13997 if (likely(__pyx_t_4)) {
13998 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
13999 __Pyx_INCREF(__pyx_t_4);
14000 __Pyx_INCREF(
function);
14001 __Pyx_DECREF_SET(__pyx_t_1,
function);
14005 #if CYTHON_FAST_PYCALL 14006 if (PyFunction_Check(__pyx_t_1)) {
14007 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
14008 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
14009 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14010 __Pyx_GOTREF(__pyx_t_2);
14011 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14014 #if CYTHON_FAST_PYCCALL 14015 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
14016 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
14017 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
14018 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14019 __Pyx_GOTREF(__pyx_t_2);
14020 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14024 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 630, __pyx_L1_error)
14025 __Pyx_GOTREF(__pyx_t_9);
14027 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
14029 __Pyx_GIVEREF(__pyx_t_5);
14030 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
14031 __Pyx_INCREF(__pyx_n_s_d);
14032 __Pyx_GIVEREF(__pyx_n_s_d);
14033 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_n_s_d);
14035 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
14036 __Pyx_GOTREF(__pyx_t_2);
14037 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14039 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14040 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 630, __pyx_L1_error)
14041 __pyx_t_10 = ((PyArrayObject *)__pyx_t_2);
14043 __Pyx_BufFmt_StackElem __pyx_stack[1];
14044 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
14045 __pyx_v_a_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf = NULL;
14046 __PYX_ERR(0, 630, __pyx_L1_error)
14047 }
else {__pyx_pybuffernd_a_up.diminfo[0].strides = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_up.diminfo[0].shape = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.shape[0];
14051 __pyx_v_a_up = ((PyArrayObject *)__pyx_t_2);
14061 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
14062 __Pyx_GOTREF(__pyx_t_1);
14063 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 631, __pyx_L1_error)
14064 __Pyx_GOTREF(__pyx_t_9);
14065 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14066 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nSpace);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
14067 __Pyx_GOTREF(__pyx_t_1);
14070 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14071 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
14072 if (likely(__pyx_t_5)) {
14073 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14074 __Pyx_INCREF(__pyx_t_5);
14075 __Pyx_INCREF(
function);
14076 __Pyx_DECREF_SET(__pyx_t_9,
function);
14080 #if CYTHON_FAST_PYCALL 14081 if (PyFunction_Check(__pyx_t_9)) {
14082 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
14083 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
14084 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14085 __Pyx_GOTREF(__pyx_t_2);
14086 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14089 #if CYTHON_FAST_PYCCALL 14090 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
14091 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
14092 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
14093 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14094 __Pyx_GOTREF(__pyx_t_2);
14095 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14099 __pyx_t_4 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error)
14100 __Pyx_GOTREF(__pyx_t_4);
14102 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
14104 __Pyx_GIVEREF(__pyx_t_1);
14105 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_t_1);
14106 __Pyx_INCREF(__pyx_n_s_d);
14107 __Pyx_GIVEREF(__pyx_n_s_d);
14108 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_n_s_d);
14110 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
14111 __Pyx_GOTREF(__pyx_t_2);
14112 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14114 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14115 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 631, __pyx_L1_error)
14116 __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
14118 __Pyx_BufFmt_StackElem __pyx_stack[1];
14119 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
14120 __pyx_v_f_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf = NULL;
14121 __PYX_ERR(0, 631, __pyx_L1_error)
14122 }
else {__pyx_pybuffernd_f_up.diminfo[0].strides = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_f_up.diminfo[0].shape = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.shape[0];
14126 __pyx_v_f_up = ((PyArrayObject *)__pyx_t_2);
14136 __pyx_t_12 = (__pyx_v_nSpace + 1.);
14137 if (unlikely(__pyx_t_12 == 0)) {
14138 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
14139 __PYX_ERR(0, 633, __pyx_L1_error)
14141 __pyx_v_nAvgWeight = (1.0 / __pyx_t_12);
14150 __pyx_v_weight = 1.0;
14151 __pyx_v_volFactor = 1.0;
14160 __pyx_v_thisElementIsUpwind = 1;
14169 __pyx_t_6 = ((__pyx_v_nSpace == 2) != 0);
14179 __pyx_v_volFactor = 0.5;
14197 __pyx_t_6 = ((__pyx_v_nSpace == 3) != 0);
14207 __pyx_v_volFactor = (1.0 / 6.0);
14225 __pyx_t_8 = __pyx_v_nElements_global;
14226 __pyx_t_13 = __pyx_t_8;
14227 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
14228 __pyx_v_eN = __pyx_t_14;
14237 __pyx_t_15 = __pyx_v_eN;
14240 if (__pyx_t_15 < 0) {
14241 __pyx_t_15 += __pyx_pybuffernd_q_detJ.diminfo[0].shape;
14242 if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 0;
14243 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_detJ.diminfo[0].shape)) __pyx_t_17 = 0;
14244 if (__pyx_t_16 < 0) {
14245 __pyx_t_16 += __pyx_pybuffernd_q_detJ.diminfo[1].shape;
14246 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1;
14247 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_q_detJ.diminfo[1].shape)) __pyx_t_17 = 1;
14248 if (unlikely(__pyx_t_17 != -1)) {
14249 __Pyx_RaiseBufferIndexError(__pyx_t_17);
14250 __PYX_ERR(0, 642, __pyx_L1_error)
14252 __pyx_v_volume = (__pyx_v_volFactor * fabs((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_detJ.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_q_detJ.diminfo[1].strides))));
14261 __pyx_v_weight = (__pyx_v_nAvgWeight * __pyx_v_volume);
14270 __pyx_t_17 = __pyx_v_nDOF_test_element;
14271 __pyx_t_18 = __pyx_t_17;
14272 for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
14273 __pyx_v_i = __pyx_t_19;
14282 __pyx_t_20 = __pyx_v_eN;
14283 __pyx_t_21 = __pyx_v_i;
14285 if (__pyx_t_20 < 0) {
14286 __pyx_t_20 += __pyx_pybuffernd_q_dmt.diminfo[0].shape;
14287 if (unlikely(__pyx_t_20 < 0)) __pyx_t_22 = 0;
14288 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_dmt.diminfo[0].shape)) __pyx_t_22 = 0;
14289 if (__pyx_t_21 < 0) {
14290 __pyx_t_21 += __pyx_pybuffernd_q_dmt.diminfo[1].shape;
14291 if (unlikely(__pyx_t_21 < 0)) __pyx_t_22 = 1;
14292 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_dmt.diminfo[1].shape)) __pyx_t_22 = 1;
14293 if (unlikely(__pyx_t_22 != -1)) {
14294 __Pyx_RaiseBufferIndexError(__pyx_t_22);
14295 __PYX_ERR(0, 650, __pyx_L1_error)
14297 __pyx_t_23 = __pyx_v_eN;
14298 __pyx_t_24 = __pyx_v_i;
14299 __pyx_t_25 = __pyx_v_i;
14301 if (__pyx_t_23 < 0) {
14302 __pyx_t_23 += __pyx_pybuffernd_elementJacobian.diminfo[0].shape;
14303 if (unlikely(__pyx_t_23 < 0)) __pyx_t_22 = 0;
14304 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_elementJacobian.diminfo[0].shape)) __pyx_t_22 = 0;
14305 if (__pyx_t_24 < 0) {
14306 __pyx_t_24 += __pyx_pybuffernd_elementJacobian.diminfo[1].shape;
14307 if (unlikely(__pyx_t_24 < 0)) __pyx_t_22 = 1;
14308 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_elementJacobian.diminfo[1].shape)) __pyx_t_22 = 1;
14309 if (__pyx_t_25 < 0) {
14310 __pyx_t_25 += __pyx_pybuffernd_elementJacobian.diminfo[2].shape;
14311 if (unlikely(__pyx_t_25 < 0)) __pyx_t_22 = 2;
14312 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_elementJacobian.diminfo[2].shape)) __pyx_t_22 = 2;
14313 if (unlikely(__pyx_t_22 != -1)) {
14314 __Pyx_RaiseBufferIndexError(__pyx_t_22);
14315 __PYX_ERR(0, 650, __pyx_L1_error)
14317 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_elementJacobian.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_elementJacobian.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_elementJacobian.diminfo[2].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_q_dmt.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_q_dmt.diminfo[1].strides)));
14326 __pyx_t_22 = __pyx_v_nElementBoundaries_element;
14327 __pyx_t_26 = __pyx_t_22;
14328 for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) {
14329 __pyx_v_ebN = __pyx_t_27;
14338 __pyx_t_28 = __pyx_v_nnz;
14339 __pyx_t_29 = __pyx_t_28;
14340 for (__pyx_t_30 = 0; __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) {
14341 __pyx_v_ii = __pyx_t_30;
14350 __pyx_t_31 = __pyx_v_eN;
14351 __pyx_t_32 = __pyx_v_ebN;
14352 __pyx_t_33 = __pyx_v_ii;
14354 if (__pyx_t_31 < 0) {
14355 __pyx_t_31 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
14356 if (unlikely(__pyx_t_31 < 0)) __pyx_t_34 = 0;
14357 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_34 = 0;
14358 if (__pyx_t_32 < 0) {
14359 __pyx_t_32 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
14360 if (unlikely(__pyx_t_32 < 0)) __pyx_t_34 = 1;
14361 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_34 = 1;
14362 if (__pyx_t_33 < 0) {
14363 __pyx_t_33 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
14364 if (unlikely(__pyx_t_33 < 0)) __pyx_t_34 = 2;
14365 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_34 = 2;
14366 if (unlikely(__pyx_t_34 != -1)) {
14367 __Pyx_RaiseBufferIndexError(__pyx_t_34);
14368 __PYX_ERR(0, 656, __pyx_L1_error)
14370 __pyx_t_35 = __pyx_v_eN;
14371 __pyx_t_36 = __pyx_v_ebN;
14373 if (__pyx_t_35 < 0) {
14374 __pyx_t_35 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
14375 if (unlikely(__pyx_t_35 < 0)) __pyx_t_34 = 0;
14376 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_34 = 0;
14377 if (__pyx_t_36 < 0) {
14378 __pyx_t_36 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
14379 if (unlikely(__pyx_t_36 < 0)) __pyx_t_34 = 1;
14380 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_34 = 1;
14381 if (unlikely(__pyx_t_34 != -1)) {
14382 __Pyx_RaiseBufferIndexError(__pyx_t_34);
14383 __PYX_ERR(0, 656, __pyx_L1_error)
14385 __pyx_t_37 = __pyx_v_ii;
14387 if (__pyx_t_37 < 0) {
14388 __pyx_t_37 += __pyx_pybuffernd_a_up.diminfo[0].shape;
14389 if (unlikely(__pyx_t_37 < 0)) __pyx_t_34 = 0;
14390 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_34 = 0;
14391 if (unlikely(__pyx_t_34 != -1)) {
14392 __Pyx_RaiseBufferIndexError(__pyx_t_34);
14393 __PYX_ERR(0, 656, __pyx_L1_error)
14395 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_a_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_q_alin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
14405 __pyx_t_28 = __pyx_v_nSpace;
14406 __pyx_t_29 = __pyx_t_28;
14407 for (__pyx_t_30 = 0; __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) {
14408 __pyx_v_I = __pyx_t_30;
14417 __pyx_t_38 = __pyx_v_eN;
14418 __pyx_t_39 = __pyx_v_ebN;
14419 __pyx_t_40 = __pyx_v_I;
14421 if (__pyx_t_38 < 0) {
14422 __pyx_t_38 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
14423 if (unlikely(__pyx_t_38 < 0)) __pyx_t_34 = 0;
14424 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_34 = 0;
14425 if (__pyx_t_39 < 0) {
14426 __pyx_t_39 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
14427 if (unlikely(__pyx_t_39 < 0)) __pyx_t_34 = 1;
14428 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_34 = 1;
14429 if (__pyx_t_40 < 0) {
14430 __pyx_t_40 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
14431 if (unlikely(__pyx_t_40 < 0)) __pyx_t_34 = 2;
14432 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_34 = 2;
14433 if (unlikely(__pyx_t_34 != -1)) {
14434 __Pyx_RaiseBufferIndexError(__pyx_t_34);
14435 __PYX_ERR(0, 658, __pyx_L1_error)
14437 __pyx_t_41 = __pyx_v_eN;
14438 __pyx_t_42 = __pyx_v_ebN;
14440 if (__pyx_t_41 < 0) {
14441 __pyx_t_41 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
14442 if (unlikely(__pyx_t_41 < 0)) __pyx_t_34 = 0;
14443 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_34 = 0;
14444 if (__pyx_t_42 < 0) {
14445 __pyx_t_42 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
14446 if (unlikely(__pyx_t_42 < 0)) __pyx_t_34 = 1;
14447 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_34 = 1;
14448 if (unlikely(__pyx_t_34 != -1)) {
14449 __Pyx_RaiseBufferIndexError(__pyx_t_34);
14450 __PYX_ERR(0, 658, __pyx_L1_error)
14452 __pyx_t_43 = __pyx_v_I;
14454 if (__pyx_t_43 < 0) {
14455 __pyx_t_43 += __pyx_pybuffernd_f_up.diminfo[0].shape;
14456 if (unlikely(__pyx_t_43 < 0)) __pyx_t_34 = 0;
14457 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_34 = 0;
14458 if (unlikely(__pyx_t_34 != -1)) {
14459 __Pyx_RaiseBufferIndexError(__pyx_t_34);
14460 __PYX_ERR(0, 658, __pyx_L1_error)
14462 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_f_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_40, __pyx_pybuffernd_q_flin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
14472 __pyx_t_28 = __pyx_v_nDOF_trial_element;
14473 __pyx_t_29 = __pyx_t_28;
14474 for (__pyx_t_30 = 0; __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) {
14475 __pyx_v_j = __pyx_t_30;
14484 __pyx_t_34 = __pyx_v_nSpace;
14485 __pyx_t_44 = __pyx_t_34;
14486 for (__pyx_t_45 = 0; __pyx_t_45 < __pyx_t_44; __pyx_t_45+=1) {
14487 __pyx_v_I = __pyx_t_45;
14496 __pyx_t_46 = (__pyx_v_I + 1);
14498 if (__pyx_t_46 < 0) {
14499 __pyx_t_46 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
14500 if (unlikely(__pyx_t_46 < 0)) __pyx_t_47 = 0;
14501 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_47 = 0;
14502 if (unlikely(__pyx_t_47 != -1)) {
14503 __Pyx_RaiseBufferIndexError(__pyx_t_47);
14504 __PYX_ERR(0, 664, __pyx_L1_error)
14506 __pyx_t_48 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_rowptr.diminfo[0].strides));
14507 __pyx_t_49 = __pyx_v_I;
14509 if (__pyx_t_49 < 0) {
14510 __pyx_t_49 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
14511 if (unlikely(__pyx_t_49 < 0)) __pyx_t_47 = 0;
14512 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_47 = 0;
14513 if (unlikely(__pyx_t_47 != -1)) {
14514 __Pyx_RaiseBufferIndexError(__pyx_t_47);
14515 __PYX_ERR(0, 664, __pyx_L1_error)
14517 __pyx_t_50 = __pyx_t_48;
14518 for (__pyx_t_47 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_47 < __pyx_t_50; __pyx_t_47+=1) {
14519 __pyx_v_ii = __pyx_t_47;
14528 __pyx_t_51 = __pyx_v_ii;
14530 if (__pyx_t_51 < 0) {
14531 __pyx_t_51 += __pyx_pybuffernd_a_up.diminfo[0].shape;
14532 if (unlikely(__pyx_t_51 < 0)) __pyx_t_52 = 0;
14533 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_52 = 0;
14534 if (unlikely(__pyx_t_52 != -1)) {
14535 __Pyx_RaiseBufferIndexError(__pyx_t_52);
14536 __PYX_ERR(0, 665, __pyx_L1_error)
14538 __pyx_t_53 = __pyx_v_ii;
14540 if (__pyx_t_53 < 0) {
14541 __pyx_t_53 += __pyx_pybuffernd_colind.diminfo[0].shape;
14542 if (unlikely(__pyx_t_53 < 0)) __pyx_t_52 = 0;
14543 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_52 = 0;
14544 if (unlikely(__pyx_t_52 != -1)) {
14545 __Pyx_RaiseBufferIndexError(__pyx_t_52);
14546 __PYX_ERR(0, 665, __pyx_L1_error)
14548 __pyx_t_54 = __pyx_v_eN;
14549 __pyx_t_55 = __pyx_v_ebN;
14550 __pyx_t_56 = __pyx_v_j;
14551 __pyx_t_57 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_colind.diminfo[0].strides));
14553 if (__pyx_t_54 < 0) {
14554 __pyx_t_54 += __pyx_pybuffernd_q_grad_v.diminfo[0].shape;
14555 if (unlikely(__pyx_t_54 < 0)) __pyx_t_52 = 0;
14556 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_q_grad_v.diminfo[0].shape)) __pyx_t_52 = 0;
14557 if (__pyx_t_55 < 0) {
14558 __pyx_t_55 += __pyx_pybuffernd_q_grad_v.diminfo[1].shape;
14559 if (unlikely(__pyx_t_55 < 0)) __pyx_t_52 = 1;
14560 }
else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_q_grad_v.diminfo[1].shape)) __pyx_t_52 = 1;
14561 if (__pyx_t_56 < 0) {
14562 __pyx_t_56 += __pyx_pybuffernd_q_grad_v.diminfo[2].shape;
14563 if (unlikely(__pyx_t_56 < 0)) __pyx_t_52 = 2;
14564 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_q_grad_v.diminfo[2].shape)) __pyx_t_52 = 2;
14565 if (__pyx_t_57 < 0) {
14566 __pyx_t_57 += __pyx_pybuffernd_q_grad_v.diminfo[3].shape;
14567 if (unlikely(__pyx_t_57 < 0)) __pyx_t_52 = 3;
14568 }
else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_q_grad_v.diminfo[3].shape)) __pyx_t_52 = 3;
14569 if (unlikely(__pyx_t_52 != -1)) {
14570 __Pyx_RaiseBufferIndexError(__pyx_t_52);
14571 __PYX_ERR(0, 665, __pyx_L1_error)
14573 __pyx_t_58 = __pyx_v_eN;
14574 __pyx_t_59 = __pyx_v_ebN;
14575 __pyx_t_60 = __pyx_v_i;
14576 __pyx_t_61 = __pyx_v_I;
14578 if (__pyx_t_58 < 0) {
14579 __pyx_t_58 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
14580 if (unlikely(__pyx_t_58 < 0)) __pyx_t_52 = 0;
14581 }
else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_52 = 0;
14582 if (__pyx_t_59 < 0) {
14583 __pyx_t_59 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
14584 if (unlikely(__pyx_t_59 < 0)) __pyx_t_52 = 1;
14585 }
else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_52 = 1;
14586 if (__pyx_t_60 < 0) {
14587 __pyx_t_60 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
14588 if (unlikely(__pyx_t_60 < 0)) __pyx_t_52 = 2;
14589 }
else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_52 = 2;
14590 if (__pyx_t_61 < 0) {
14591 __pyx_t_61 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
14592 if (unlikely(__pyx_t_61 < 0)) __pyx_t_52 = 3;
14593 }
else if (unlikely(__pyx_t_61 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_52 = 3;
14594 if (unlikely(__pyx_t_52 != -1)) {
14595 __Pyx_RaiseBufferIndexError(__pyx_t_52);
14596 __PYX_ERR(0, 665, __pyx_L1_error)
14598 __pyx_t_62 = __pyx_v_eN;
14599 __pyx_t_63 = __pyx_v_i;
14600 __pyx_t_64 = __pyx_v_j;
14602 if (__pyx_t_62 < 0) {
14603 __pyx_t_62 += __pyx_pybuffernd_elementJacobian.diminfo[0].shape;
14604 if (unlikely(__pyx_t_62 < 0)) __pyx_t_52 = 0;
14605 }
else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_elementJacobian.diminfo[0].shape)) __pyx_t_52 = 0;
14606 if (__pyx_t_63 < 0) {
14607 __pyx_t_63 += __pyx_pybuffernd_elementJacobian.diminfo[1].shape;
14608 if (unlikely(__pyx_t_63 < 0)) __pyx_t_52 = 1;
14609 }
else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd_elementJacobian.diminfo[1].shape)) __pyx_t_52 = 1;
14610 if (__pyx_t_64 < 0) {
14611 __pyx_t_64 += __pyx_pybuffernd_elementJacobian.diminfo[2].shape;
14612 if (unlikely(__pyx_t_64 < 0)) __pyx_t_52 = 2;
14613 }
else if (unlikely(__pyx_t_64 >= __pyx_pybuffernd_elementJacobian.diminfo[2].shape)) __pyx_t_52 = 2;
14614 if (unlikely(__pyx_t_52 != -1)) {
14615 __Pyx_RaiseBufferIndexError(__pyx_t_52);
14616 __PYX_ERR(0, 665, __pyx_L1_error)
14618 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.buf, __pyx_t_62, __pyx_pybuffernd_elementJacobian.diminfo[0].strides, __pyx_t_63, __pyx_pybuffernd_elementJacobian.diminfo[1].strides, __pyx_t_64, __pyx_pybuffernd_elementJacobian.diminfo[2].strides) += (((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_a_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_q_grad_v.diminfo[0].strides, __pyx_t_55, __pyx_pybuffernd_q_grad_v.diminfo[1].strides, __pyx_t_56, __pyx_pybuffernd_q_grad_v.diminfo[2].strides, __pyx_t_57, __pyx_pybuffernd_q_grad_v.diminfo[3].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_59, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_60, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_61, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
14635 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14638 __Pyx_XDECREF(__pyx_t_1);
14639 __Pyx_XDECREF(__pyx_t_2);
14640 __Pyx_XDECREF(__pyx_t_4);
14641 __Pyx_XDECREF(__pyx_t_5);
14642 __Pyx_XDECREF(__pyx_t_9);
14643 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
14644 __Pyx_PyThreadState_declare
14645 __Pyx_PyThreadState_assign
14646 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
14647 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
14648 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
14649 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
14650 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer);
14651 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
14652 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
14653 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
14654 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
14655 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
14656 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
14657 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer);
14658 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer);
14659 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
14660 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
14661 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer);
14662 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
14663 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
14664 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
14665 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
14666 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
14667 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
14668 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
14669 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
14670 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
14671 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
14675 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
14676 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
14677 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
14678 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer);
14679 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
14680 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
14681 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
14682 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
14683 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
14684 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
14685 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer);
14686 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer);
14687 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
14688 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
14689 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer);
14690 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
14691 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
14692 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
14693 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
14694 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
14695 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
14696 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
14697 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
14699 __Pyx_XDECREF(__pyx_v_q);
14700 __Pyx_XDECREF((PyObject *)__pyx_v_a_up);
14701 __Pyx_XDECREF((PyObject *)__pyx_v_f_up);
14702 __Pyx_XGIVEREF(__pyx_r);
14703 __Pyx_RefNannyFinishContext();
14716 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14717 static char __pyx_doc_28subsurfaceTransportFunctions_36updateMass_weakAvg[] =
"\n approximate element mass term as (\010ar{c}_e,w_{h,i})_e\n ";
14718 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_37updateMass_weakAvg = {
"updateMass_weakAvg", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_36updateMass_weakAvg};
14719 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14720 PyArrayObject *__pyx_v_mt = 0;
14721 PyArrayObject *__pyx_v_w = 0;
14722 PyArrayObject *__pyx_v_dV = 0;
14723 PyArrayObject *__pyx_v_weak_residual = 0;
14724 PyObject *__pyx_r = 0;
14725 __Pyx_RefNannyDeclarations
14726 __Pyx_RefNannySetupContext(
"updateMass_weakAvg (wrapper)", 0);
14728 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mt,&__pyx_n_s_w,&__pyx_n_s_dV,&__pyx_n_s_weak_residual,0};
14729 PyObject* values[4] = {0,0,0,0};
14730 if (unlikely(__pyx_kwds)) {
14731 Py_ssize_t kw_args;
14732 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14733 switch (pos_args) {
14734 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14735 CYTHON_FALLTHROUGH;
14736 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14737 CYTHON_FALLTHROUGH;
14738 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14739 CYTHON_FALLTHROUGH;
14740 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14741 CYTHON_FALLTHROUGH;
14743 default:
goto __pyx_L5_argtuple_error;
14745 kw_args = PyDict_Size(__pyx_kwds);
14746 switch (pos_args) {
14748 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mt)) != 0)) kw_args--;
14749 else goto __pyx_L5_argtuple_error;
14750 CYTHON_FALLTHROUGH;
14752 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
14754 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 1); __PYX_ERR(0, 673, __pyx_L3_error)
14756 CYTHON_FALLTHROUGH;
14758 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
14760 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 2); __PYX_ERR(0, 673, __pyx_L3_error)
14762 CYTHON_FALLTHROUGH;
14764 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weak_residual)) != 0)) kw_args--;
14766 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 3); __PYX_ERR(0, 673, __pyx_L3_error)
14769 if (unlikely(kw_args > 0)) {
14770 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"updateMass_weakAvg") < 0)) __PYX_ERR(0, 673, __pyx_L3_error)
14772 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
14773 goto __pyx_L5_argtuple_error;
14775 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14776 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14777 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14778 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14780 __pyx_v_mt = ((PyArrayObject *)values[0]);
14781 __pyx_v_w = ((PyArrayObject *)values[1]);
14782 __pyx_v_dV = ((PyArrayObject *)values[2]);
14783 __pyx_v_weak_residual = ((PyArrayObject *)values[3]);
14785 goto __pyx_L4_argument_unpacking_done;
14786 __pyx_L5_argtuple_error:;
14787 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 673, __pyx_L3_error)
14789 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMass_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
14790 __Pyx_RefNannyFinishContext();
14792 __pyx_L4_argument_unpacking_done:;
14793 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mt), __pyx_ptype_5numpy_ndarray, 1,
"mt", 0))) __PYX_ERR(0, 673, __pyx_L1_error)
14794 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_5numpy_ndarray, 1,
"w", 0))) __PYX_ERR(0, 674, __pyx_L1_error)
14795 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 675, __pyx_L1_error)
14796 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weak_residual), __pyx_ptype_5numpy_ndarray, 1,
"weak_residual", 0))) __PYX_ERR(0, 676, __pyx_L1_error)
14797 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(__pyx_self, __pyx_v_mt, __pyx_v_w, __pyx_v_dV, __pyx_v_weak_residual);
14804 __Pyx_RefNannyFinishContext();
14808 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_weak_residual) {
14812 PyObject *__pyx_v_mt_avg = 0;
14813 PyObject *__pyx_v_vol = 0;
14814 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
14815 __Pyx_Buffer __pyx_pybuffer_dV;
14816 __Pyx_LocalBuf_ND __pyx_pybuffernd_mt;
14817 __Pyx_Buffer __pyx_pybuffer_mt;
14818 __Pyx_LocalBuf_ND __pyx_pybuffernd_w;
14819 __Pyx_Buffer __pyx_pybuffer_w;
14820 __Pyx_LocalBuf_ND __pyx_pybuffernd_weak_residual;
14821 __Pyx_Buffer __pyx_pybuffer_weak_residual;
14822 PyObject *__pyx_r = NULL;
14823 __Pyx_RefNannyDeclarations
14824 npy_intp __pyx_t_1;
14825 npy_intp __pyx_t_2;
14827 npy_intp __pyx_t_4;
14828 npy_intp __pyx_t_5;
14830 Py_ssize_t __pyx_t_7;
14831 Py_ssize_t __pyx_t_8;
14833 Py_ssize_t __pyx_t_10;
14834 Py_ssize_t __pyx_t_11;
14835 PyObject *__pyx_t_12 = NULL;
14836 PyObject *__pyx_t_13 = NULL;
14837 Py_ssize_t __pyx_t_14;
14838 Py_ssize_t __pyx_t_15;
14839 Py_ssize_t __pyx_t_16;
14840 Py_ssize_t __pyx_t_17;
14841 Py_ssize_t __pyx_t_18;
14842 Py_ssize_t __pyx_t_19;
14843 Py_ssize_t __pyx_t_20;
14844 PyObject *__pyx_t_21 = NULL;
14846 Py_ssize_t __pyx_t_23;
14847 Py_ssize_t __pyx_t_24;
14848 __Pyx_RefNannySetupContext(
"updateMass_weakAvg", 0);
14849 __pyx_pybuffer_mt.pybuffer.buf = NULL;
14850 __pyx_pybuffer_mt.refcount = 0;
14851 __pyx_pybuffernd_mt.data = NULL;
14852 __pyx_pybuffernd_mt.rcbuffer = &__pyx_pybuffer_mt;
14853 __pyx_pybuffer_w.pybuffer.buf = NULL;
14854 __pyx_pybuffer_w.refcount = 0;
14855 __pyx_pybuffernd_w.data = NULL;
14856 __pyx_pybuffernd_w.rcbuffer = &__pyx_pybuffer_w;
14857 __pyx_pybuffer_dV.pybuffer.buf = NULL;
14858 __pyx_pybuffer_dV.refcount = 0;
14859 __pyx_pybuffernd_dV.data = NULL;
14860 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
14861 __pyx_pybuffer_weak_residual.pybuffer.buf = NULL;
14862 __pyx_pybuffer_weak_residual.refcount = 0;
14863 __pyx_pybuffernd_weak_residual.data = NULL;
14864 __pyx_pybuffernd_weak_residual.rcbuffer = &__pyx_pybuffer_weak_residual;
14866 __Pyx_BufFmt_StackElem __pyx_stack[1];
14867 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14869 __pyx_pybuffernd_mt.diminfo[0].strides = __pyx_pybuffernd_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mt.diminfo[0].shape = __pyx_pybuffernd_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mt.diminfo[1].strides = __pyx_pybuffernd_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mt.diminfo[1].shape = __pyx_pybuffernd_mt.rcbuffer->pybuffer.shape[1];
14871 __Pyx_BufFmt_StackElem __pyx_stack[1];
14872 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14874 __pyx_pybuffernd_w.diminfo[0].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_w.diminfo[0].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_w.diminfo[1].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_w.diminfo[1].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_w.diminfo[2].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_w.diminfo[2].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[2];
14876 __Pyx_BufFmt_StackElem __pyx_stack[1];
14877 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14879 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
14881 __Pyx_BufFmt_StackElem __pyx_stack[1];
14882 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer, (PyObject*)__pyx_v_weak_residual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14884 __pyx_pybuffernd_weak_residual.diminfo[0].strides = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_weak_residual.diminfo[0].shape = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_weak_residual.diminfo[1].strides = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_weak_residual.diminfo[1].shape = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.shape[1];
14893 __pyx_t_1 = (__pyx_v_mt->dimensions[0]);
14894 __pyx_t_2 = __pyx_t_1;
14895 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
14896 __pyx_v_eN = __pyx_t_3;
14905 __Pyx_INCREF(__pyx_float_0_0);
14906 __Pyx_XDECREF_SET(__pyx_v_mt_avg, __pyx_float_0_0);
14915 __Pyx_INCREF(__pyx_float_0_0);
14916 __Pyx_XDECREF_SET(__pyx_v_vol, __pyx_float_0_0);
14925 __pyx_t_4 = (__pyx_v_mt->dimensions[1]);
14926 __pyx_t_5 = __pyx_t_4;
14927 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
14928 __pyx_v_k = __pyx_t_6;
14937 __pyx_t_7 = __pyx_v_eN;
14938 __pyx_t_8 = __pyx_v_k;
14940 if (__pyx_t_7 < 0) {
14941 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
14942 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
14943 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
14944 if (__pyx_t_8 < 0) {
14945 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
14946 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
14947 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
14948 if (unlikely(__pyx_t_9 != -1)) {
14949 __Pyx_RaiseBufferIndexError(__pyx_t_9);
14950 __PYX_ERR(0, 686, __pyx_L1_error)
14952 __pyx_t_10 = __pyx_v_eN;
14953 __pyx_t_11 = __pyx_v_k;
14955 if (__pyx_t_10 < 0) {
14956 __pyx_t_10 += __pyx_pybuffernd_mt.diminfo[0].shape;
14957 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
14958 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_mt.diminfo[0].shape)) __pyx_t_9 = 0;
14959 if (__pyx_t_11 < 0) {
14960 __pyx_t_11 += __pyx_pybuffernd_mt.diminfo[1].shape;
14961 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
14962 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_mt.diminfo[1].shape)) __pyx_t_9 = 1;
14963 if (unlikely(__pyx_t_9 != -1)) {
14964 __Pyx_RaiseBufferIndexError(__pyx_t_9);
14965 __PYX_ERR(0, 686, __pyx_L1_error)
14967 __pyx_t_12 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_mt.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_mt.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_mt.diminfo[1].strides))));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 686, __pyx_L1_error)
14968 __Pyx_GOTREF(__pyx_t_12);
14969 __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_v_mt_avg, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 686, __pyx_L1_error)
14970 __Pyx_GOTREF(__pyx_t_13);
14971 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
14972 __Pyx_DECREF_SET(__pyx_v_mt_avg, __pyx_t_13);
14982 __pyx_t_14 = __pyx_v_eN;
14983 __pyx_t_15 = __pyx_v_k;
14985 if (__pyx_t_14 < 0) {
14986 __pyx_t_14 += __pyx_pybuffernd_dV.diminfo[0].shape;
14987 if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0;
14988 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
14989 if (__pyx_t_15 < 0) {
14990 __pyx_t_15 += __pyx_pybuffernd_dV.diminfo[1].shape;
14991 if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 1;
14992 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
14993 if (unlikely(__pyx_t_9 != -1)) {
14994 __Pyx_RaiseBufferIndexError(__pyx_t_9);
14995 __PYX_ERR(0, 687, __pyx_L1_error)
14997 __pyx_t_13 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_dV.diminfo[1].strides)));
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 687, __pyx_L1_error)
14998 __Pyx_GOTREF(__pyx_t_13);
14999 __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_v_vol, __pyx_t_13);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 687, __pyx_L1_error)
15000 __Pyx_GOTREF(__pyx_t_12);
15001 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
15002 __Pyx_DECREF_SET(__pyx_v_vol, __pyx_t_12);
15013 __pyx_t_12 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_mt_avg, __pyx_v_vol);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 688, __pyx_L1_error)
15014 __Pyx_GOTREF(__pyx_t_12);
15015 __Pyx_DECREF_SET(__pyx_v_mt_avg, __pyx_t_12);
15025 __pyx_t_4 = (__pyx_v_weak_residual->dimensions[1]);
15026 __pyx_t_5 = __pyx_t_4;
15027 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15028 __pyx_v_i = __pyx_t_6;
15037 __pyx_t_16 = __pyx_v_eN;
15038 __pyx_t_17 = __pyx_v_k;
15039 __pyx_t_18 = __pyx_v_i;
15041 if (__pyx_t_16 < 0) {
15042 __pyx_t_16 += __pyx_pybuffernd_w.diminfo[0].shape;
15043 if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0;
15044 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_w.diminfo[0].shape)) __pyx_t_9 = 0;
15045 if (__pyx_t_17 < 0) {
15046 __pyx_t_17 += __pyx_pybuffernd_w.diminfo[1].shape;
15047 if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 1;
15048 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_w.diminfo[1].shape)) __pyx_t_9 = 1;
15049 if (__pyx_t_18 < 0) {
15050 __pyx_t_18 += __pyx_pybuffernd_w.diminfo[2].shape;
15051 if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 2;
15052 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_w.diminfo[2].shape)) __pyx_t_9 = 2;
15053 if (unlikely(__pyx_t_9 != -1)) {
15054 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15055 __PYX_ERR(0, 691, __pyx_L1_error)
15057 __pyx_t_12 = PyFloat_FromDouble((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_w.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_w.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_w.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_w.diminfo[2].strides)));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 691, __pyx_L1_error)
15058 __Pyx_GOTREF(__pyx_t_12);
15059 __pyx_t_13 = PyNumber_Multiply(__pyx_v_mt_avg, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 691, __pyx_L1_error)
15060 __Pyx_GOTREF(__pyx_t_13);
15061 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15062 __pyx_t_19 = __pyx_v_eN;
15063 __pyx_t_20 = __pyx_v_k;
15065 if (__pyx_t_19 < 0) {
15066 __pyx_t_19 += __pyx_pybuffernd_dV.diminfo[0].shape;
15067 if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0;
15068 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
15069 if (__pyx_t_20 < 0) {
15070 __pyx_t_20 += __pyx_pybuffernd_dV.diminfo[1].shape;
15071 if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 1;
15072 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
15073 if (unlikely(__pyx_t_9 != -1)) {
15074 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15075 __PYX_ERR(0, 691, __pyx_L1_error)
15077 __pyx_t_12 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_dV.diminfo[1].strides)));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 691, __pyx_L1_error)
15078 __Pyx_GOTREF(__pyx_t_12);
15079 __pyx_t_21 = PyNumber_Multiply(__pyx_t_13, __pyx_t_12);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 691, __pyx_L1_error)
15080 __Pyx_GOTREF(__pyx_t_21);
15081 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
15082 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15083 __pyx_t_22 = __Pyx_PyObject_AsDouble(__pyx_t_21);
if (unlikely(__pyx_t_22 == ((
double)((
double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 691, __pyx_L1_error)
15084 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
15085 __pyx_t_23 = __pyx_v_eN;
15086 __pyx_t_24 = __pyx_v_i;
15088 if (__pyx_t_23 < 0) {
15089 __pyx_t_23 += __pyx_pybuffernd_weak_residual.diminfo[0].shape;
15090 if (unlikely(__pyx_t_23 < 0)) __pyx_t_9 = 0;
15091 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_weak_residual.diminfo[0].shape)) __pyx_t_9 = 0;
15092 if (__pyx_t_24 < 0) {
15093 __pyx_t_24 += __pyx_pybuffernd_weak_residual.diminfo[1].shape;
15094 if (unlikely(__pyx_t_24 < 0)) __pyx_t_9 = 1;
15095 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_weak_residual.diminfo[1].shape)) __pyx_t_9 = 1;
15096 if (unlikely(__pyx_t_9 != -1)) {
15097 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15098 __PYX_ERR(0, 691, __pyx_L1_error)
15100 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_weak_residual.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_weak_residual.diminfo[1].strides) += __pyx_t_22;
15113 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15116 __Pyx_XDECREF(__pyx_t_12);
15117 __Pyx_XDECREF(__pyx_t_13);
15118 __Pyx_XDECREF(__pyx_t_21);
15119 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15120 __Pyx_PyThreadState_declare
15121 __Pyx_PyThreadState_assign
15122 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15123 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15124 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mt.rcbuffer->pybuffer);
15125 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15126 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer);
15127 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15128 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMass_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
15132 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15133 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mt.rcbuffer->pybuffer);
15134 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15135 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer);
15137 __Pyx_XDECREF(__pyx_v_mt_avg);
15138 __Pyx_XDECREF(__pyx_v_vol);
15139 __Pyx_XGIVEREF(__pyx_r);
15140 __Pyx_RefNannyFinishContext();
15153 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15154 static char __pyx_doc_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg[] =
"\n approximate element mass Jacobian term as (\\pd{\010ar{c}_e}{u_j},w_{h,i})_e\n ";
15155 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg = {
"updateMassJacobian_weakAvg", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg};
15156 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15157 PyArrayObject *__pyx_v_dmt = 0;
15158 PyArrayObject *__pyx_v_w = 0;
15159 PyArrayObject *__pyx_v_v = 0;
15160 PyArrayObject *__pyx_v_dV = 0;
15161 PyArrayObject *__pyx_v_jacobian_weak_residual = 0;
15162 PyObject *__pyx_r = 0;
15163 __Pyx_RefNannyDeclarations
15164 __Pyx_RefNannySetupContext(
"updateMassJacobian_weakAvg (wrapper)", 0);
15166 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dmt,&__pyx_n_s_w,&__pyx_n_s_v,&__pyx_n_s_dV,&__pyx_n_s_jacobian_weak_residual,0};
15167 PyObject* values[5] = {0,0,0,0,0};
15168 if (unlikely(__pyx_kwds)) {
15169 Py_ssize_t kw_args;
15170 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15171 switch (pos_args) {
15172 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15173 CYTHON_FALLTHROUGH;
15174 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15175 CYTHON_FALLTHROUGH;
15176 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15177 CYTHON_FALLTHROUGH;
15178 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15179 CYTHON_FALLTHROUGH;
15180 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15181 CYTHON_FALLTHROUGH;
15183 default:
goto __pyx_L5_argtuple_error;
15185 kw_args = PyDict_Size(__pyx_kwds);
15186 switch (pos_args) {
15188 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
15189 else goto __pyx_L5_argtuple_error;
15190 CYTHON_FALLTHROUGH;
15192 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
15194 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 1); __PYX_ERR(0, 692, __pyx_L3_error)
15196 CYTHON_FALLTHROUGH;
15198 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
15200 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 2); __PYX_ERR(0, 692, __pyx_L3_error)
15202 CYTHON_FALLTHROUGH;
15204 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
15206 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 3); __PYX_ERR(0, 692, __pyx_L3_error)
15208 CYTHON_FALLTHROUGH;
15210 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jacobian_weak_residual)) != 0)) kw_args--;
15212 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 4); __PYX_ERR(0, 692, __pyx_L3_error)
15215 if (unlikely(kw_args > 0)) {
15216 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"updateMassJacobian_weakAvg") < 0)) __PYX_ERR(0, 692, __pyx_L3_error)
15218 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
15219 goto __pyx_L5_argtuple_error;
15221 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15222 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15223 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15224 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15225 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15227 __pyx_v_dmt = ((PyArrayObject *)values[0]);
15228 __pyx_v_w = ((PyArrayObject *)values[1]);
15229 __pyx_v_v = ((PyArrayObject *)values[2]);
15230 __pyx_v_dV = ((PyArrayObject *)values[3]);
15231 __pyx_v_jacobian_weak_residual = ((PyArrayObject *)values[4]);
15233 goto __pyx_L4_argument_unpacking_done;
15234 __pyx_L5_argtuple_error:;
15235 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 692, __pyx_L3_error)
15237 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMassJacobian_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
15238 __Pyx_RefNannyFinishContext();
15240 __pyx_L4_argument_unpacking_done:;
15241 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1,
"dmt", 0))) __PYX_ERR(0, 692, __pyx_L1_error)
15242 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_5numpy_ndarray, 1,
"w", 0))) __PYX_ERR(0, 693, __pyx_L1_error)
15243 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 694, __pyx_L1_error)
15244 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 695, __pyx_L1_error)
15245 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_jacobian_weak_residual), __pyx_ptype_5numpy_ndarray, 1,
"jacobian_weak_residual", 0))) __PYX_ERR(0, 696, __pyx_L1_error)
15246 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(__pyx_self, __pyx_v_dmt, __pyx_v_w, __pyx_v_v, __pyx_v_dV, __pyx_v_jacobian_weak_residual);
15253 __Pyx_RefNannyFinishContext();
15257 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_jacobian_weak_residual) {
15262 double __pyx_v_dmtj_avg;
15263 double __pyx_v_vol;
15264 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
15265 __Pyx_Buffer __pyx_pybuffer_dV;
15266 __Pyx_LocalBuf_ND __pyx_pybuffernd_dmt;
15267 __Pyx_Buffer __pyx_pybuffer_dmt;
15268 __Pyx_LocalBuf_ND __pyx_pybuffernd_jacobian_weak_residual;
15269 __Pyx_Buffer __pyx_pybuffer_jacobian_weak_residual;
15270 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
15271 __Pyx_Buffer __pyx_pybuffer_v;
15272 __Pyx_LocalBuf_ND __pyx_pybuffernd_w;
15273 __Pyx_Buffer __pyx_pybuffer_w;
15274 PyObject *__pyx_r = NULL;
15275 __Pyx_RefNannyDeclarations
15276 npy_intp __pyx_t_1;
15277 npy_intp __pyx_t_2;
15279 npy_intp __pyx_t_4;
15280 npy_intp __pyx_t_5;
15282 Py_ssize_t __pyx_t_7;
15283 Py_ssize_t __pyx_t_8;
15285 npy_intp __pyx_t_10;
15286 npy_intp __pyx_t_11;
15287 npy_intp __pyx_t_12;
15288 npy_intp __pyx_t_13;
15290 Py_ssize_t __pyx_t_15;
15291 Py_ssize_t __pyx_t_16;
15293 Py_ssize_t __pyx_t_18;
15294 Py_ssize_t __pyx_t_19;
15295 Py_ssize_t __pyx_t_20;
15296 Py_ssize_t __pyx_t_21;
15297 Py_ssize_t __pyx_t_22;
15298 Py_ssize_t __pyx_t_23;
15299 Py_ssize_t __pyx_t_24;
15300 Py_ssize_t __pyx_t_25;
15301 Py_ssize_t __pyx_t_26;
15302 Py_ssize_t __pyx_t_27;
15303 Py_ssize_t __pyx_t_28;
15304 Py_ssize_t __pyx_t_29;
15305 Py_ssize_t __pyx_t_30;
15306 __Pyx_RefNannySetupContext(
"updateMassJacobian_weakAvg", 0);
15307 __pyx_pybuffer_dmt.pybuffer.buf = NULL;
15308 __pyx_pybuffer_dmt.refcount = 0;
15309 __pyx_pybuffernd_dmt.data = NULL;
15310 __pyx_pybuffernd_dmt.rcbuffer = &__pyx_pybuffer_dmt;
15311 __pyx_pybuffer_w.pybuffer.buf = NULL;
15312 __pyx_pybuffer_w.refcount = 0;
15313 __pyx_pybuffernd_w.data = NULL;
15314 __pyx_pybuffernd_w.rcbuffer = &__pyx_pybuffer_w;
15315 __pyx_pybuffer_v.pybuffer.buf = NULL;
15316 __pyx_pybuffer_v.refcount = 0;
15317 __pyx_pybuffernd_v.data = NULL;
15318 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
15319 __pyx_pybuffer_dV.pybuffer.buf = NULL;
15320 __pyx_pybuffer_dV.refcount = 0;
15321 __pyx_pybuffernd_dV.data = NULL;
15322 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
15323 __pyx_pybuffer_jacobian_weak_residual.pybuffer.buf = NULL;
15324 __pyx_pybuffer_jacobian_weak_residual.refcount = 0;
15325 __pyx_pybuffernd_jacobian_weak_residual.data = NULL;
15326 __pyx_pybuffernd_jacobian_weak_residual.rcbuffer = &__pyx_pybuffer_jacobian_weak_residual;
15328 __Pyx_BufFmt_StackElem __pyx_stack[1];
15329 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer, (PyObject*)__pyx_v_dmt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15331 __pyx_pybuffernd_dmt.diminfo[0].strides = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dmt.diminfo[0].shape = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dmt.diminfo[1].strides = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dmt.diminfo[1].shape = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.shape[1];
15333 __Pyx_BufFmt_StackElem __pyx_stack[1];
15334 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15336 __pyx_pybuffernd_w.diminfo[0].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_w.diminfo[0].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_w.diminfo[1].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_w.diminfo[1].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_w.diminfo[2].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_w.diminfo[2].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[2];
15338 __Pyx_BufFmt_StackElem __pyx_stack[1];
15339 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15341 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
15343 __Pyx_BufFmt_StackElem __pyx_stack[1];
15344 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15346 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
15348 __Pyx_BufFmt_StackElem __pyx_stack[1];
15349 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer, (PyObject*)__pyx_v_jacobian_weak_residual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15351 __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[2];
15360 __pyx_t_1 = (__pyx_v_dmt->dimensions[0]);
15361 __pyx_t_2 = __pyx_t_1;
15362 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
15363 __pyx_v_eN = __pyx_t_3;
15381 __pyx_t_4 = (__pyx_v_dmt->dimensions[1]);
15382 __pyx_t_5 = __pyx_t_4;
15383 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15384 __pyx_v_k = __pyx_t_6;
15393 __pyx_t_7 = __pyx_v_eN;
15394 __pyx_t_8 = __pyx_v_k;
15396 if (__pyx_t_7 < 0) {
15397 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
15398 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
15399 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
15400 if (__pyx_t_8 < 0) {
15401 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
15402 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
15403 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
15404 if (unlikely(__pyx_t_9 != -1)) {
15405 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15406 __PYX_ERR(0, 705, __pyx_L1_error)
15408 __pyx_v_vol = (__pyx_v_vol + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)));
15418 __pyx_t_4 = (__pyx_v_w->dimensions[2]);
15419 __pyx_t_5 = __pyx_t_4;
15420 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15421 __pyx_v_i = __pyx_t_6;
15430 __pyx_t_10 = (__pyx_v_v->dimensions[2]);
15431 __pyx_t_11 = __pyx_t_10;
15432 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
15433 __pyx_v_j = __pyx_t_9;
15442 __pyx_v_dmtj_avg = 0.0;
15451 __pyx_t_12 = (__pyx_v_dmt->dimensions[1]);
15452 __pyx_t_13 = __pyx_t_12;
15453 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
15454 __pyx_v_k = __pyx_t_14;
15463 __pyx_t_15 = __pyx_v_eN;
15464 __pyx_t_16 = __pyx_v_k;
15466 if (__pyx_t_15 < 0) {
15467 __pyx_t_15 += __pyx_pybuffernd_dV.diminfo[0].shape;
15468 if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 0;
15469 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_17 = 0;
15470 if (__pyx_t_16 < 0) {
15471 __pyx_t_16 += __pyx_pybuffernd_dV.diminfo[1].shape;
15472 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1;
15473 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_17 = 1;
15474 if (unlikely(__pyx_t_17 != -1)) {
15475 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15476 __PYX_ERR(0, 710, __pyx_L1_error)
15478 __pyx_t_18 = __pyx_v_eN;
15479 __pyx_t_19 = __pyx_v_k;
15481 if (__pyx_t_18 < 0) {
15482 __pyx_t_18 += __pyx_pybuffernd_dmt.diminfo[0].shape;
15483 if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 0;
15484 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_dmt.diminfo[0].shape)) __pyx_t_17 = 0;
15485 if (__pyx_t_19 < 0) {
15486 __pyx_t_19 += __pyx_pybuffernd_dmt.diminfo[1].shape;
15487 if (unlikely(__pyx_t_19 < 0)) __pyx_t_17 = 1;
15488 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_dmt.diminfo[1].shape)) __pyx_t_17 = 1;
15489 if (unlikely(__pyx_t_17 != -1)) {
15490 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15491 __PYX_ERR(0, 710, __pyx_L1_error)
15493 __pyx_t_20 = __pyx_v_eN;
15494 __pyx_t_21 = __pyx_v_k;
15495 __pyx_t_22 = __pyx_v_j;
15497 if (__pyx_t_20 < 0) {
15498 __pyx_t_20 += __pyx_pybuffernd_v.diminfo[0].shape;
15499 if (unlikely(__pyx_t_20 < 0)) __pyx_t_17 = 0;
15500 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_17 = 0;
15501 if (__pyx_t_21 < 0) {
15502 __pyx_t_21 += __pyx_pybuffernd_v.diminfo[1].shape;
15503 if (unlikely(__pyx_t_21 < 0)) __pyx_t_17 = 1;
15504 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_17 = 1;
15505 if (__pyx_t_22 < 0) {
15506 __pyx_t_22 += __pyx_pybuffernd_v.diminfo[2].shape;
15507 if (unlikely(__pyx_t_22 < 0)) __pyx_t_17 = 2;
15508 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_17 = 2;
15509 if (unlikely(__pyx_t_17 != -1)) {
15510 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15511 __PYX_ERR(0, 710, __pyx_L1_error)
15513 __pyx_v_dmtj_avg = (__pyx_v_dmtj_avg + (((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dmt.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_dmt.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_dmt.diminfo[1].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_v.diminfo[2].strides))));
15523 if (unlikely(__pyx_v_vol == 0)) {
15524 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
15525 __PYX_ERR(0, 711, __pyx_L1_error)
15527 __pyx_v_dmtj_avg = (__pyx_v_dmtj_avg / __pyx_v_vol);
15536 __pyx_t_23 = __pyx_v_eN;
15537 __pyx_t_24 = __pyx_v_k;
15538 __pyx_t_25 = __pyx_v_i;
15540 if (__pyx_t_23 < 0) {
15541 __pyx_t_23 += __pyx_pybuffernd_w.diminfo[0].shape;
15542 if (unlikely(__pyx_t_23 < 0)) __pyx_t_14 = 0;
15543 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_w.diminfo[0].shape)) __pyx_t_14 = 0;
15544 if (__pyx_t_24 < 0) {
15545 __pyx_t_24 += __pyx_pybuffernd_w.diminfo[1].shape;
15546 if (unlikely(__pyx_t_24 < 0)) __pyx_t_14 = 1;
15547 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_w.diminfo[1].shape)) __pyx_t_14 = 1;
15548 if (__pyx_t_25 < 0) {
15549 __pyx_t_25 += __pyx_pybuffernd_w.diminfo[2].shape;
15550 if (unlikely(__pyx_t_25 < 0)) __pyx_t_14 = 2;
15551 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_w.diminfo[2].shape)) __pyx_t_14 = 2;
15552 if (unlikely(__pyx_t_14 != -1)) {
15553 __Pyx_RaiseBufferIndexError(__pyx_t_14);
15554 __PYX_ERR(0, 712, __pyx_L1_error)
15556 __pyx_t_26 = __pyx_v_eN;
15557 __pyx_t_27 = __pyx_v_k;
15559 if (__pyx_t_26 < 0) {
15560 __pyx_t_26 += __pyx_pybuffernd_dV.diminfo[0].shape;
15561 if (unlikely(__pyx_t_26 < 0)) __pyx_t_14 = 0;
15562 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_14 = 0;
15563 if (__pyx_t_27 < 0) {
15564 __pyx_t_27 += __pyx_pybuffernd_dV.diminfo[1].shape;
15565 if (unlikely(__pyx_t_27 < 0)) __pyx_t_14 = 1;
15566 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_14 = 1;
15567 if (unlikely(__pyx_t_14 != -1)) {
15568 __Pyx_RaiseBufferIndexError(__pyx_t_14);
15569 __PYX_ERR(0, 712, __pyx_L1_error)
15571 __pyx_t_28 = __pyx_v_eN;
15572 __pyx_t_29 = __pyx_v_i;
15573 __pyx_t_30 = __pyx_v_j;
15575 if (__pyx_t_28 < 0) {
15576 __pyx_t_28 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape;
15577 if (unlikely(__pyx_t_28 < 0)) __pyx_t_14 = 0;
15578 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape)) __pyx_t_14 = 0;
15579 if (__pyx_t_29 < 0) {
15580 __pyx_t_29 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape;
15581 if (unlikely(__pyx_t_29 < 0)) __pyx_t_14 = 1;
15582 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape)) __pyx_t_14 = 1;
15583 if (__pyx_t_30 < 0) {
15584 __pyx_t_30 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape;
15585 if (unlikely(__pyx_t_30 < 0)) __pyx_t_14 = 2;
15586 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape)) __pyx_t_14 = 2;
15587 if (unlikely(__pyx_t_14 != -1)) {
15588 __Pyx_RaiseBufferIndexError(__pyx_t_14);
15589 __PYX_ERR(0, 712, __pyx_L1_error)
15591 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].strides) += ((__pyx_v_dmtj_avg * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_w.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_w.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_w.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_w.diminfo[2].strides))) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_dV.diminfo[1].strides)));
15605 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15608 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15609 __Pyx_PyThreadState_declare
15610 __Pyx_PyThreadState_assign
15611 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15612 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15613 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer);
15614 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer);
15615 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
15616 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15617 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15618 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMassJacobian_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
15622 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15623 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer);
15624 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer);
15625 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
15626 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15628 __Pyx_XGIVEREF(__pyx_r);
15629 __Pyx_RefNannyFinishContext();
15642 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15643 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_41calculateNormalFlux = {
"calculateNormalFlux", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux, METH_VARARGS|METH_KEYWORDS, 0};
15644 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15645 PyArrayObject *__pyx_v_v = 0;
15646 PyArrayObject *__pyx_v_n = 0;
15647 PyArrayObject *__pyx_v_dS = 0;
15648 PyArrayObject *__pyx_v_flux = 0;
15649 PyObject *__pyx_r = 0;
15650 __Pyx_RefNannyDeclarations
15651 __Pyx_RefNannySetupContext(
"calculateNormalFlux (wrapper)", 0);
15653 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_n,&__pyx_n_s_dS,&__pyx_n_s_flux,0};
15654 PyObject* values[4] = {0,0,0,0};
15655 if (unlikely(__pyx_kwds)) {
15656 Py_ssize_t kw_args;
15657 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15658 switch (pos_args) {
15659 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15660 CYTHON_FALLTHROUGH;
15661 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15662 CYTHON_FALLTHROUGH;
15663 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15664 CYTHON_FALLTHROUGH;
15665 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15666 CYTHON_FALLTHROUGH;
15668 default:
goto __pyx_L5_argtuple_error;
15670 kw_args = PyDict_Size(__pyx_kwds);
15671 switch (pos_args) {
15673 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
15674 else goto __pyx_L5_argtuple_error;
15675 CYTHON_FALLTHROUGH;
15677 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
15679 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 1); __PYX_ERR(0, 717, __pyx_L3_error)
15681 CYTHON_FALLTHROUGH;
15683 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dS)) != 0)) kw_args--;
15685 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 2); __PYX_ERR(0, 717, __pyx_L3_error)
15687 CYTHON_FALLTHROUGH;
15689 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flux)) != 0)) kw_args--;
15691 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 3); __PYX_ERR(0, 717, __pyx_L3_error)
15694 if (unlikely(kw_args > 0)) {
15695 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"calculateNormalFlux") < 0)) __PYX_ERR(0, 717, __pyx_L3_error)
15697 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
15698 goto __pyx_L5_argtuple_error;
15700 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15701 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15702 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15703 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15705 __pyx_v_v = ((PyArrayObject *)values[0]);
15706 __pyx_v_n = ((PyArrayObject *)values[1]);
15707 __pyx_v_dS = ((PyArrayObject *)values[2]);
15708 __pyx_v_flux = ((PyArrayObject *)values[3]);
15710 goto __pyx_L4_argument_unpacking_done;
15711 __pyx_L5_argtuple_error:;
15712 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 717, __pyx_L3_error)
15714 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.calculateNormalFlux", __pyx_clineno, __pyx_lineno, __pyx_filename);
15715 __Pyx_RefNannyFinishContext();
15717 __pyx_L4_argument_unpacking_done:;
15718 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 717, __pyx_L1_error)
15719 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), __pyx_ptype_5numpy_ndarray, 1,
"n", 0))) __PYX_ERR(0, 718, __pyx_L1_error)
15720 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dS), __pyx_ptype_5numpy_ndarray, 1,
"dS", 0))) __PYX_ERR(0, 719, __pyx_L1_error)
15721 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_flux), __pyx_ptype_5numpy_ndarray, 1,
"flux", 0))) __PYX_ERR(0, 720, __pyx_L1_error)
15722 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(__pyx_self, __pyx_v_v, __pyx_v_n, __pyx_v_dS, __pyx_v_flux);
15729 __Pyx_RefNannyFinishContext();
15733 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_dS, PyArrayObject *__pyx_v_flux) {
15737 double __pyx_v_integral;
15738 npy_intp __pyx_v_I;
15739 __Pyx_LocalBuf_ND __pyx_pybuffernd_dS;
15740 __Pyx_Buffer __pyx_pybuffer_dS;
15741 __Pyx_LocalBuf_ND __pyx_pybuffernd_flux;
15742 __Pyx_Buffer __pyx_pybuffer_flux;
15743 __Pyx_LocalBuf_ND __pyx_pybuffernd_n;
15744 __Pyx_Buffer __pyx_pybuffer_n;
15745 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
15746 __Pyx_Buffer __pyx_pybuffer_v;
15747 PyObject *__pyx_r = NULL;
15748 __Pyx_RefNannyDeclarations
15749 npy_intp __pyx_t_1;
15750 npy_intp __pyx_t_2;
15752 npy_intp __pyx_t_4;
15753 npy_intp __pyx_t_5;
15755 npy_intp __pyx_t_7;
15756 npy_intp __pyx_t_8;
15758 npy_intp __pyx_t_10;
15759 npy_intp __pyx_t_11;
15760 npy_intp __pyx_t_12;
15761 Py_ssize_t __pyx_t_13;
15762 Py_ssize_t __pyx_t_14;
15763 Py_ssize_t __pyx_t_15;
15764 Py_ssize_t __pyx_t_16;
15766 Py_ssize_t __pyx_t_18;
15767 Py_ssize_t __pyx_t_19;
15768 Py_ssize_t __pyx_t_20;
15769 Py_ssize_t __pyx_t_21;
15770 Py_ssize_t __pyx_t_22;
15771 Py_ssize_t __pyx_t_23;
15772 Py_ssize_t __pyx_t_24;
15773 Py_ssize_t __pyx_t_25;
15774 Py_ssize_t __pyx_t_26;
15775 __Pyx_RefNannySetupContext(
"calculateNormalFlux", 0);
15776 __pyx_pybuffer_v.pybuffer.buf = NULL;
15777 __pyx_pybuffer_v.refcount = 0;
15778 __pyx_pybuffernd_v.data = NULL;
15779 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
15780 __pyx_pybuffer_n.pybuffer.buf = NULL;
15781 __pyx_pybuffer_n.refcount = 0;
15782 __pyx_pybuffernd_n.data = NULL;
15783 __pyx_pybuffernd_n.rcbuffer = &__pyx_pybuffer_n;
15784 __pyx_pybuffer_dS.pybuffer.buf = NULL;
15785 __pyx_pybuffer_dS.refcount = 0;
15786 __pyx_pybuffernd_dS.data = NULL;
15787 __pyx_pybuffernd_dS.rcbuffer = &__pyx_pybuffer_dS;
15788 __pyx_pybuffer_flux.pybuffer.buf = NULL;
15789 __pyx_pybuffer_flux.refcount = 0;
15790 __pyx_pybuffernd_flux.data = NULL;
15791 __pyx_pybuffernd_flux.rcbuffer = &__pyx_pybuffer_flux;
15793 __Pyx_BufFmt_StackElem __pyx_stack[1];
15794 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15796 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
15798 __Pyx_BufFmt_StackElem __pyx_stack[1];
15799 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n.rcbuffer->pybuffer, (PyObject*)__pyx_v_n, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15801 __pyx_pybuffernd_n.diminfo[0].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n.diminfo[0].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_n.diminfo[1].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_n.diminfo[1].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_n.diminfo[2].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_n.diminfo[2].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_n.diminfo[3].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_n.diminfo[3].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[3];
15803 __Pyx_BufFmt_StackElem __pyx_stack[1];
15804 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dS.rcbuffer->pybuffer, (PyObject*)__pyx_v_dS, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15806 __pyx_pybuffernd_dS.diminfo[0].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dS.diminfo[0].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dS.diminfo[1].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dS.diminfo[1].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dS.diminfo[2].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dS.diminfo[2].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[2];
15808 __Pyx_BufFmt_StackElem __pyx_stack[1];
15809 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_flux.rcbuffer->pybuffer, (PyObject*)__pyx_v_flux, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15811 __pyx_pybuffernd_flux.diminfo[0].strides = __pyx_pybuffernd_flux.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_flux.diminfo[0].shape = __pyx_pybuffernd_flux.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_flux.diminfo[1].strides = __pyx_pybuffernd_flux.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_flux.diminfo[1].shape = __pyx_pybuffernd_flux.rcbuffer->pybuffer.shape[1];
15820 __pyx_t_1 = (__pyx_v_n->dimensions[0]);
15821 __pyx_t_2 = __pyx_t_1;
15822 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
15823 __pyx_v_eN = __pyx_t_3;
15832 __pyx_t_4 = (__pyx_v_n->dimensions[1]);
15833 __pyx_t_5 = __pyx_t_4;
15834 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15835 __pyx_v_ebN = __pyx_t_6;
15844 __pyx_v_integral = 0.0;
15853 __pyx_t_7 = (__pyx_v_n->dimensions[2]);
15854 __pyx_t_8 = __pyx_t_7;
15855 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
15856 __pyx_v_kb = __pyx_t_9;
15865 __pyx_t_10 = (__pyx_v_n->dimensions[3]);
15866 __pyx_t_11 = __pyx_t_10;
15867 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
15868 __pyx_v_I = __pyx_t_12;
15877 __pyx_t_13 = __pyx_v_eN;
15878 __pyx_t_14 = __pyx_v_ebN;
15879 __pyx_t_15 = __pyx_v_kb;
15880 __pyx_t_16 = __pyx_v_I;
15882 if (__pyx_t_13 < 0) {
15883 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[0].shape;
15884 if (unlikely(__pyx_t_13 < 0)) __pyx_t_17 = 0;
15885 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_17 = 0;
15886 if (__pyx_t_14 < 0) {
15887 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[1].shape;
15888 if (unlikely(__pyx_t_14 < 0)) __pyx_t_17 = 1;
15889 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_17 = 1;
15890 if (__pyx_t_15 < 0) {
15891 __pyx_t_15 += __pyx_pybuffernd_v.diminfo[2].shape;
15892 if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 2;
15893 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_17 = 2;
15894 if (__pyx_t_16 < 0) {
15895 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
15896 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 3;
15897 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_17 = 3;
15898 if (unlikely(__pyx_t_17 != -1)) {
15899 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15900 __PYX_ERR(0, 729, __pyx_L1_error)
15902 __pyx_t_18 = __pyx_v_eN;
15903 __pyx_t_19 = __pyx_v_ebN;
15904 __pyx_t_20 = __pyx_v_kb;
15905 __pyx_t_21 = __pyx_v_I;
15907 if (__pyx_t_18 < 0) {
15908 __pyx_t_18 += __pyx_pybuffernd_n.diminfo[0].shape;
15909 if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 0;
15910 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_17 = 0;
15911 if (__pyx_t_19 < 0) {
15912 __pyx_t_19 += __pyx_pybuffernd_n.diminfo[1].shape;
15913 if (unlikely(__pyx_t_19 < 0)) __pyx_t_17 = 1;
15914 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_n.diminfo[1].shape)) __pyx_t_17 = 1;
15915 if (__pyx_t_20 < 0) {
15916 __pyx_t_20 += __pyx_pybuffernd_n.diminfo[2].shape;
15917 if (unlikely(__pyx_t_20 < 0)) __pyx_t_17 = 2;
15918 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_n.diminfo[2].shape)) __pyx_t_17 = 2;
15919 if (__pyx_t_21 < 0) {
15920 __pyx_t_21 += __pyx_pybuffernd_n.diminfo[3].shape;
15921 if (unlikely(__pyx_t_21 < 0)) __pyx_t_17 = 3;
15922 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_n.diminfo[3].shape)) __pyx_t_17 = 3;
15923 if (unlikely(__pyx_t_17 != -1)) {
15924 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15925 __PYX_ERR(0, 729, __pyx_L1_error)
15927 __pyx_t_22 = __pyx_v_eN;
15928 __pyx_t_23 = __pyx_v_ebN;
15929 __pyx_t_24 = __pyx_v_kb;
15931 if (__pyx_t_22 < 0) {
15932 __pyx_t_22 += __pyx_pybuffernd_dS.diminfo[0].shape;
15933 if (unlikely(__pyx_t_22 < 0)) __pyx_t_17 = 0;
15934 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_dS.diminfo[0].shape)) __pyx_t_17 = 0;
15935 if (__pyx_t_23 < 0) {
15936 __pyx_t_23 += __pyx_pybuffernd_dS.diminfo[1].shape;
15937 if (unlikely(__pyx_t_23 < 0)) __pyx_t_17 = 1;
15938 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_dS.diminfo[1].shape)) __pyx_t_17 = 1;
15939 if (__pyx_t_24 < 0) {
15940 __pyx_t_24 += __pyx_pybuffernd_dS.diminfo[2].shape;
15941 if (unlikely(__pyx_t_24 < 0)) __pyx_t_17 = 2;
15942 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_dS.diminfo[2].shape)) __pyx_t_17 = 2;
15943 if (unlikely(__pyx_t_17 != -1)) {
15944 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15945 __PYX_ERR(0, 729, __pyx_L1_error)
15947 __pyx_v_integral = (__pyx_v_integral + (((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides)) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_n.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_n.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_n.diminfo[2].strides, __pyx_t_21, __pyx_pybuffernd_n.diminfo[3].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dS.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_dS.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_dS.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_dS.diminfo[2].strides))));
15958 __pyx_t_25 = __pyx_v_eN;
15959 __pyx_t_26 = __pyx_v_ebN;
15961 if (__pyx_t_25 < 0) {
15962 __pyx_t_25 += __pyx_pybuffernd_flux.diminfo[0].shape;
15963 if (unlikely(__pyx_t_25 < 0)) __pyx_t_9 = 0;
15964 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_flux.diminfo[0].shape)) __pyx_t_9 = 0;
15965 if (__pyx_t_26 < 0) {
15966 __pyx_t_26 += __pyx_pybuffernd_flux.diminfo[1].shape;
15967 if (unlikely(__pyx_t_26 < 0)) __pyx_t_9 = 1;
15968 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_flux.diminfo[1].shape)) __pyx_t_9 = 1;
15969 if (unlikely(__pyx_t_9 != -1)) {
15970 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15971 __PYX_ERR(0, 730, __pyx_L1_error)
15973 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_flux.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_flux.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_flux.diminfo[1].strides) = __pyx_v_integral;
15986 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15989 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15990 __Pyx_PyThreadState_declare
15991 __Pyx_PyThreadState_assign
15992 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15993 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
15994 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_flux.rcbuffer->pybuffer);
15995 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
15996 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
15997 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15998 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.calculateNormalFlux", __pyx_clineno, __pyx_lineno, __pyx_filename);
16002 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
16003 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_flux.rcbuffer->pybuffer);
16004 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
16005 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
16007 __Pyx_XGIVEREF(__pyx_r);
16008 __Pyx_RefNannyFinishContext();
16021 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16022 static char __pyx_doc_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity[] =
"\n simple approximation for \\lambda = df/\010ar{dm} using \010ar{dm} = \014rac{1}{\\Omega_e} \\int_{\\Omega_e} dm dV\n ";
16023 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity = {
"computeSimpleCharacteristicVelocityFromElementVelocity", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity};
16024 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16025 PyArrayObject *__pyx_v_df = 0;
16026 PyArrayObject *__pyx_v_characteristic_velocity = 0;
16027 PyArrayObject *__pyx_v_dm = 0;
16028 PyArrayObject *__pyx_v_dV = 0;
16029 PyObject *__pyx_r = 0;
16030 __Pyx_RefNannyDeclarations
16031 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromElementVelocity (wrapper)", 0);
16033 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df,&__pyx_n_s_characteristic_velocity,&__pyx_n_s_dm,&__pyx_n_s_dV,0};
16034 PyObject* values[4] = {0,0,0,0};
16035 if (unlikely(__pyx_kwds)) {
16036 Py_ssize_t kw_args;
16037 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16038 switch (pos_args) {
16039 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16040 CYTHON_FALLTHROUGH;
16041 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16042 CYTHON_FALLTHROUGH;
16043 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16044 CYTHON_FALLTHROUGH;
16045 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16046 CYTHON_FALLTHROUGH;
16048 default:
goto __pyx_L5_argtuple_error;
16050 kw_args = PyDict_Size(__pyx_kwds);
16051 switch (pos_args) {
16053 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
16054 else goto __pyx_L5_argtuple_error;
16055 CYTHON_FALLTHROUGH;
16057 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_characteristic_velocity)) != 0)) kw_args--;
16059 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 1); __PYX_ERR(0, 732, __pyx_L3_error)
16061 CYTHON_FALLTHROUGH;
16063 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
16065 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 2); __PYX_ERR(0, 732, __pyx_L3_error)
16067 CYTHON_FALLTHROUGH;
16069 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
16071 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 3); __PYX_ERR(0, 732, __pyx_L3_error)
16074 if (unlikely(kw_args > 0)) {
16075 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"computeSimpleCharacteristicVelocityFromElementVelocity") < 0)) __PYX_ERR(0, 732, __pyx_L3_error)
16077 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
16078 goto __pyx_L5_argtuple_error;
16080 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16081 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16082 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16083 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16085 __pyx_v_df = ((PyArrayObject *)values[0]);
16086 __pyx_v_characteristic_velocity = ((PyArrayObject *)values[1]);
16087 __pyx_v_dm = ((PyArrayObject *)values[2]);
16088 __pyx_v_dV = ((PyArrayObject *)values[3]);
16090 goto __pyx_L4_argument_unpacking_done;
16091 __pyx_L5_argtuple_error:;
16092 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 732, __pyx_L3_error)
16094 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromElementVelocity", __pyx_clineno, __pyx_lineno, __pyx_filename);
16095 __Pyx_RefNannyFinishContext();
16097 __pyx_L4_argument_unpacking_done:;
16098 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_ptype_5numpy_ndarray, 1,
"df", 0))) __PYX_ERR(0, 732, __pyx_L1_error)
16099 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_characteristic_velocity), __pyx_ptype_5numpy_ndarray, 1,
"characteristic_velocity", 0))) __PYX_ERR(0, 733, __pyx_L1_error)
16100 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1,
"dm", 0))) __PYX_ERR(0, 734, __pyx_L1_error)
16101 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 735, __pyx_L1_error)
16102 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(__pyx_self, __pyx_v_df, __pyx_v_characteristic_velocity, __pyx_v_dm, __pyx_v_dV);
16109 __Pyx_RefNannyFinishContext();
16113 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_characteristic_velocity, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV) {
16117 double __pyx_v_omega_e;
16118 double __pyx_v_vol_e;
16119 __Pyx_LocalBuf_ND __pyx_pybuffernd_characteristic_velocity;
16120 __Pyx_Buffer __pyx_pybuffer_characteristic_velocity;
16121 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
16122 __Pyx_Buffer __pyx_pybuffer_dV;
16123 __Pyx_LocalBuf_ND __pyx_pybuffernd_df;
16124 __Pyx_Buffer __pyx_pybuffer_df;
16125 __Pyx_LocalBuf_ND __pyx_pybuffernd_dm;
16126 __Pyx_Buffer __pyx_pybuffer_dm;
16127 PyObject *__pyx_r = NULL;
16128 __Pyx_RefNannyDeclarations
16129 npy_intp __pyx_t_1;
16130 npy_intp __pyx_t_2;
16132 npy_intp __pyx_t_4;
16133 npy_intp __pyx_t_5;
16135 Py_ssize_t __pyx_t_7;
16136 Py_ssize_t __pyx_t_8;
16138 Py_ssize_t __pyx_t_10;
16139 Py_ssize_t __pyx_t_11;
16140 Py_ssize_t __pyx_t_12;
16141 Py_ssize_t __pyx_t_13;
16142 npy_intp __pyx_t_14;
16143 npy_intp __pyx_t_15;
16144 Py_ssize_t __pyx_t_16;
16145 Py_ssize_t __pyx_t_17;
16146 Py_ssize_t __pyx_t_18;
16148 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_20;
16150 Py_ssize_t __pyx_t_22;
16151 Py_ssize_t __pyx_t_23;
16152 Py_ssize_t __pyx_t_24;
16153 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromElementVelocity", 0);
16154 __pyx_pybuffer_df.pybuffer.buf = NULL;
16155 __pyx_pybuffer_df.refcount = 0;
16156 __pyx_pybuffernd_df.data = NULL;
16157 __pyx_pybuffernd_df.rcbuffer = &__pyx_pybuffer_df;
16158 __pyx_pybuffer_characteristic_velocity.pybuffer.buf = NULL;
16159 __pyx_pybuffer_characteristic_velocity.refcount = 0;
16160 __pyx_pybuffernd_characteristic_velocity.data = NULL;
16161 __pyx_pybuffernd_characteristic_velocity.rcbuffer = &__pyx_pybuffer_characteristic_velocity;
16162 __pyx_pybuffer_dm.pybuffer.buf = NULL;
16163 __pyx_pybuffer_dm.refcount = 0;
16164 __pyx_pybuffernd_dm.data = NULL;
16165 __pyx_pybuffernd_dm.rcbuffer = &__pyx_pybuffer_dm;
16166 __pyx_pybuffer_dV.pybuffer.buf = NULL;
16167 __pyx_pybuffer_dV.refcount = 0;
16168 __pyx_pybuffernd_dV.data = NULL;
16169 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
16171 __Pyx_BufFmt_StackElem __pyx_stack[1];
16172 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_df.rcbuffer->pybuffer, (PyObject*)__pyx_v_df, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16174 __pyx_pybuffernd_df.diminfo[0].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_df.diminfo[0].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_df.diminfo[1].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_df.diminfo[1].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_df.diminfo[2].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_df.diminfo[2].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[2];
16176 __Pyx_BufFmt_StackElem __pyx_stack[1];
16177 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer, (PyObject*)__pyx_v_characteristic_velocity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16179 __pyx_pybuffernd_characteristic_velocity.diminfo[0].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_characteristic_velocity.diminfo[1].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_characteristic_velocity.diminfo[2].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[2];
16181 __Pyx_BufFmt_StackElem __pyx_stack[1];
16182 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16184 __pyx_pybuffernd_dm.diminfo[0].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm.diminfo[0].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm.diminfo[1].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm.diminfo[1].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[1];
16186 __Pyx_BufFmt_StackElem __pyx_stack[1];
16187 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16189 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
16198 __pyx_t_1 = (__pyx_v_dm->dimensions[0]);
16199 __pyx_t_2 = __pyx_t_1;
16200 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
16201 __pyx_v_eN = __pyx_t_3;
16210 __pyx_v_omega_e = 0.0;
16219 __pyx_v_vol_e = 0.0;
16228 __pyx_t_4 = (__pyx_v_dm->dimensions[1]);
16229 __pyx_t_5 = __pyx_t_4;
16230 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16231 __pyx_v_k = __pyx_t_6;
16240 __pyx_t_7 = __pyx_v_eN;
16241 __pyx_t_8 = __pyx_v_k;
16243 if (__pyx_t_7 < 0) {
16244 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
16245 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
16246 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16247 if (__pyx_t_8 < 0) {
16248 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
16249 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
16250 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16251 if (unlikely(__pyx_t_9 != -1)) {
16252 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16253 __PYX_ERR(0, 747, __pyx_L1_error)
16255 __pyx_v_vol_e = (__pyx_v_vol_e + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)));
16264 __pyx_t_10 = __pyx_v_eN;
16265 __pyx_t_11 = __pyx_v_k;
16267 if (__pyx_t_10 < 0) {
16268 __pyx_t_10 += __pyx_pybuffernd_dV.diminfo[0].shape;
16269 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
16270 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16271 if (__pyx_t_11 < 0) {
16272 __pyx_t_11 += __pyx_pybuffernd_dV.diminfo[1].shape;
16273 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
16274 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16275 if (unlikely(__pyx_t_9 != -1)) {
16276 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16277 __PYX_ERR(0, 748, __pyx_L1_error)
16279 __pyx_t_12 = __pyx_v_eN;
16280 __pyx_t_13 = __pyx_v_k;
16282 if (__pyx_t_12 < 0) {
16283 __pyx_t_12 += __pyx_pybuffernd_dm.diminfo[0].shape;
16284 if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 0;
16285 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_dm.diminfo[0].shape)) __pyx_t_9 = 0;
16286 if (__pyx_t_13 < 0) {
16287 __pyx_t_13 += __pyx_pybuffernd_dm.diminfo[1].shape;
16288 if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 1;
16289 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_dm.diminfo[1].shape)) __pyx_t_9 = 1;
16290 if (unlikely(__pyx_t_9 != -1)) {
16291 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16292 __PYX_ERR(0, 748, __pyx_L1_error)
16294 __pyx_v_omega_e = (__pyx_v_omega_e + ((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dm.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_dm.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_dm.diminfo[1].strides))));
16304 __pyx_t_4 = (__pyx_v_df->dimensions[1]);
16305 __pyx_t_5 = __pyx_t_4;
16306 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16307 __pyx_v_k = __pyx_t_6;
16316 __pyx_t_14 = (__pyx_v_df->dimensions[2]);
16317 __pyx_t_15 = __pyx_t_14;
16318 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_15; __pyx_t_9+=1) {
16319 __pyx_v_I = __pyx_t_9;
16328 __pyx_t_16 = __pyx_v_eN;
16329 __pyx_t_17 = __pyx_v_k;
16330 __pyx_t_18 = __pyx_v_I;
16332 if (__pyx_t_16 < 0) {
16333 __pyx_t_16 += __pyx_pybuffernd_df.diminfo[0].shape;
16334 if (unlikely(__pyx_t_16 < 0)) __pyx_t_19 = 0;
16335 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_df.diminfo[0].shape)) __pyx_t_19 = 0;
16336 if (__pyx_t_17 < 0) {
16337 __pyx_t_17 += __pyx_pybuffernd_df.diminfo[1].shape;
16338 if (unlikely(__pyx_t_17 < 0)) __pyx_t_19 = 1;
16339 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_df.diminfo[1].shape)) __pyx_t_19 = 1;
16340 if (__pyx_t_18 < 0) {
16341 __pyx_t_18 += __pyx_pybuffernd_df.diminfo[2].shape;
16342 if (unlikely(__pyx_t_18 < 0)) __pyx_t_19 = 2;
16343 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_df.diminfo[2].shape)) __pyx_t_19 = 2;
16344 if (unlikely(__pyx_t_19 != -1)) {
16345 __Pyx_RaiseBufferIndexError(__pyx_t_19);
16346 __PYX_ERR(0, 751, __pyx_L1_error)
16348 __pyx_t_20 = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_df.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_df.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_df.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_df.diminfo[2].strides)) * __pyx_v_vol_e);
16349 __pyx_t_21 = (__pyx_v_omega_e + 1.0e-12);
16350 if (unlikely(__pyx_t_21 == 0)) {
16351 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
16352 __PYX_ERR(0, 751, __pyx_L1_error)
16354 __pyx_t_22 = __pyx_v_eN;
16355 __pyx_t_23 = __pyx_v_k;
16356 __pyx_t_24 = __pyx_v_I;
16358 if (__pyx_t_22 < 0) {
16359 __pyx_t_22 += __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape;
16360 if (unlikely(__pyx_t_22 < 0)) __pyx_t_19 = 0;
16361 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape)) __pyx_t_19 = 0;
16362 if (__pyx_t_23 < 0) {
16363 __pyx_t_23 += __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape;
16364 if (unlikely(__pyx_t_23 < 0)) __pyx_t_19 = 1;
16365 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape)) __pyx_t_19 = 1;
16366 if (__pyx_t_24 < 0) {
16367 __pyx_t_24 += __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape;
16368 if (unlikely(__pyx_t_24 < 0)) __pyx_t_19 = 2;
16369 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape)) __pyx_t_19 = 2;
16370 if (unlikely(__pyx_t_19 != -1)) {
16371 __Pyx_RaiseBufferIndexError(__pyx_t_19);
16372 __PYX_ERR(0, 751, __pyx_L1_error)
16374 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_characteristic_velocity.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_characteristic_velocity.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_characteristic_velocity.diminfo[2].strides) = (__pyx_t_20 / __pyx_t_21);
16388 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16391 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
16392 __Pyx_PyThreadState_declare
16393 __Pyx_PyThreadState_assign
16394 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
16395 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer);
16396 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16397 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df.rcbuffer->pybuffer);
16398 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16399 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
16400 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromElementVelocity", __pyx_clineno, __pyx_lineno, __pyx_filename);
16404 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer);
16405 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16406 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df.rcbuffer->pybuffer);
16407 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16409 __Pyx_XGIVEREF(__pyx_r);
16410 __Pyx_RefNannyFinishContext();
16423 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16424 static char __pyx_doc_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs[] =
"\n simple approximation for \\lambda = df/\010ar{dm} using \010ar{dm} = \014rac{1}{\\Omega_e} \\int_{\\Omega_e} dm dV\n ";
16425 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs = {
"computeSimpleCharacteristicVelocityFromVelocityDOFs", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs};
16426 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16427 PyArrayObject *__pyx_v_df_dofs = 0;
16428 PyArrayObject *__pyx_v_characteristic_velocity_dofs = 0;
16429 PyArrayObject *__pyx_v_l2g = 0;
16430 PyArrayObject *__pyx_v_dm = 0;
16431 PyArrayObject *__pyx_v_dV = 0;
16432 PyObject *__pyx_r = 0;
16433 __Pyx_RefNannyDeclarations
16434 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromVelocityDOFs (wrapper)", 0);
16436 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df_dofs,&__pyx_n_s_characteristic_velocity_dofs,&__pyx_n_s_l2g,&__pyx_n_s_dm,&__pyx_n_s_dV,0};
16437 PyObject* values[5] = {0,0,0,0,0};
16438 if (unlikely(__pyx_kwds)) {
16439 Py_ssize_t kw_args;
16440 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16441 switch (pos_args) {
16442 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16443 CYTHON_FALLTHROUGH;
16444 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16445 CYTHON_FALLTHROUGH;
16446 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16447 CYTHON_FALLTHROUGH;
16448 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16449 CYTHON_FALLTHROUGH;
16450 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16451 CYTHON_FALLTHROUGH;
16453 default:
goto __pyx_L5_argtuple_error;
16455 kw_args = PyDict_Size(__pyx_kwds);
16456 switch (pos_args) {
16458 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df_dofs)) != 0)) kw_args--;
16459 else goto __pyx_L5_argtuple_error;
16460 CYTHON_FALLTHROUGH;
16462 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_characteristic_velocity_dofs)) != 0)) kw_args--;
16464 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 1); __PYX_ERR(0, 753, __pyx_L3_error)
16466 CYTHON_FALLTHROUGH;
16468 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_l2g)) != 0)) kw_args--;
16470 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 2); __PYX_ERR(0, 753, __pyx_L3_error)
16472 CYTHON_FALLTHROUGH;
16474 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
16476 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 3); __PYX_ERR(0, 753, __pyx_L3_error)
16478 CYTHON_FALLTHROUGH;
16480 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
16482 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 4); __PYX_ERR(0, 753, __pyx_L3_error)
16485 if (unlikely(kw_args > 0)) {
16486 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"computeSimpleCharacteristicVelocityFromVelocityDOFs") < 0)) __PYX_ERR(0, 753, __pyx_L3_error)
16488 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
16489 goto __pyx_L5_argtuple_error;
16491 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16492 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16493 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16494 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16495 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16497 __pyx_v_df_dofs = ((PyArrayObject *)values[0]);
16498 __pyx_v_characteristic_velocity_dofs = ((PyArrayObject *)values[1]);
16499 __pyx_v_l2g = ((PyArrayObject *)values[2]);
16500 __pyx_v_dm = ((PyArrayObject *)values[3]);
16501 __pyx_v_dV = ((PyArrayObject *)values[4]);
16503 goto __pyx_L4_argument_unpacking_done;
16504 __pyx_L5_argtuple_error:;
16505 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 753, __pyx_L3_error)
16507 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromVelocityDOFs", __pyx_clineno, __pyx_lineno, __pyx_filename);
16508 __Pyx_RefNannyFinishContext();
16510 __pyx_L4_argument_unpacking_done:;
16511 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df_dofs), __pyx_ptype_5numpy_ndarray, 1,
"df_dofs", 0))) __PYX_ERR(0, 753, __pyx_L1_error)
16512 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_characteristic_velocity_dofs), __pyx_ptype_5numpy_ndarray, 1,
"characteristic_velocity_dofs", 0))) __PYX_ERR(0, 754, __pyx_L1_error)
16513 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l2g), __pyx_ptype_5numpy_ndarray, 1,
"l2g", 0))) __PYX_ERR(0, 755, __pyx_L1_error)
16514 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1,
"dm", 0))) __PYX_ERR(0, 756, __pyx_L1_error)
16515 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 757, __pyx_L1_error)
16516 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(__pyx_self, __pyx_v_df_dofs, __pyx_v_characteristic_velocity_dofs, __pyx_v_l2g, __pyx_v_dm, __pyx_v_dV);
16523 __Pyx_RefNannyFinishContext();
16527 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df_dofs, PyArrayObject *__pyx_v_characteristic_velocity_dofs, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV) {
16532 double __pyx_v_omega_e;
16533 double __pyx_v_vol_e;
16534 __Pyx_LocalBuf_ND __pyx_pybuffernd_characteristic_velocity_dofs;
16535 __Pyx_Buffer __pyx_pybuffer_characteristic_velocity_dofs;
16536 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
16537 __Pyx_Buffer __pyx_pybuffer_dV;
16538 __Pyx_LocalBuf_ND __pyx_pybuffernd_df_dofs;
16539 __Pyx_Buffer __pyx_pybuffer_df_dofs;
16540 __Pyx_LocalBuf_ND __pyx_pybuffernd_dm;
16541 __Pyx_Buffer __pyx_pybuffer_dm;
16542 __Pyx_LocalBuf_ND __pyx_pybuffernd_l2g;
16543 __Pyx_Buffer __pyx_pybuffer_l2g;
16544 PyObject *__pyx_r = NULL;
16545 __Pyx_RefNannyDeclarations
16546 npy_intp __pyx_t_1;
16547 npy_intp __pyx_t_2;
16549 npy_intp __pyx_t_4;
16550 npy_intp __pyx_t_5;
16552 Py_ssize_t __pyx_t_7;
16553 Py_ssize_t __pyx_t_8;
16555 Py_ssize_t __pyx_t_10;
16556 Py_ssize_t __pyx_t_11;
16557 Py_ssize_t __pyx_t_12;
16558 Py_ssize_t __pyx_t_13;
16559 Py_ssize_t __pyx_t_14;
16560 Py_ssize_t __pyx_t_15;
16561 Py_ssize_t __pyx_t_16;
16562 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_17;
16564 Py_ssize_t __pyx_t_19;
16565 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 0);
16566 __pyx_pybuffer_df_dofs.pybuffer.buf = NULL;
16567 __pyx_pybuffer_df_dofs.refcount = 0;
16568 __pyx_pybuffernd_df_dofs.data = NULL;
16569 __pyx_pybuffernd_df_dofs.rcbuffer = &__pyx_pybuffer_df_dofs;
16570 __pyx_pybuffer_characteristic_velocity_dofs.pybuffer.buf = NULL;
16571 __pyx_pybuffer_characteristic_velocity_dofs.refcount = 0;
16572 __pyx_pybuffernd_characteristic_velocity_dofs.data = NULL;
16573 __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer = &__pyx_pybuffer_characteristic_velocity_dofs;
16574 __pyx_pybuffer_l2g.pybuffer.buf = NULL;
16575 __pyx_pybuffer_l2g.refcount = 0;
16576 __pyx_pybuffernd_l2g.data = NULL;
16577 __pyx_pybuffernd_l2g.rcbuffer = &__pyx_pybuffer_l2g;
16578 __pyx_pybuffer_dm.pybuffer.buf = NULL;
16579 __pyx_pybuffer_dm.refcount = 0;
16580 __pyx_pybuffernd_dm.data = NULL;
16581 __pyx_pybuffernd_dm.rcbuffer = &__pyx_pybuffer_dm;
16582 __pyx_pybuffer_dV.pybuffer.buf = NULL;
16583 __pyx_pybuffer_dV.refcount = 0;
16584 __pyx_pybuffernd_dV.data = NULL;
16585 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
16587 __Pyx_BufFmt_StackElem __pyx_stack[1];
16588 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer, (PyObject*)__pyx_v_df_dofs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16590 __pyx_pybuffernd_df_dofs.diminfo[0].strides = __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_df_dofs.diminfo[0].shape = __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.shape[0];
16592 __Pyx_BufFmt_StackElem __pyx_stack[1];
16593 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer, (PyObject*)__pyx_v_characteristic_velocity_dofs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16595 __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].strides = __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape = __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.shape[0];
16597 __Pyx_BufFmt_StackElem __pyx_stack[1];
16598 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer, (PyObject*)__pyx_v_l2g, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16600 __pyx_pybuffernd_l2g.diminfo[0].strides = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_l2g.diminfo[0].shape = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_l2g.diminfo[1].strides = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_l2g.diminfo[1].shape = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.shape[1];
16602 __Pyx_BufFmt_StackElem __pyx_stack[1];
16603 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16605 __pyx_pybuffernd_dm.diminfo[0].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm.diminfo[0].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm.diminfo[1].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm.diminfo[1].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[1];
16607 __Pyx_BufFmt_StackElem __pyx_stack[1];
16608 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16610 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
16619 __pyx_t_1 = (__pyx_v_dm->dimensions[0]);
16620 __pyx_t_2 = __pyx_t_1;
16621 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
16622 __pyx_v_eN = __pyx_t_3;
16631 __pyx_v_omega_e = 0.0;
16640 __pyx_v_vol_e = 0.0;
16649 __pyx_t_4 = (__pyx_v_dm->dimensions[1]);
16650 __pyx_t_5 = __pyx_t_4;
16651 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16652 __pyx_v_k = __pyx_t_6;
16661 __pyx_t_7 = __pyx_v_eN;
16662 __pyx_t_8 = __pyx_v_k;
16664 if (__pyx_t_7 < 0) {
16665 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
16666 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
16667 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16668 if (__pyx_t_8 < 0) {
16669 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
16670 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
16671 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16672 if (unlikely(__pyx_t_9 != -1)) {
16673 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16674 __PYX_ERR(0, 769, __pyx_L1_error)
16676 __pyx_v_vol_e = (__pyx_v_vol_e + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)));
16685 __pyx_t_10 = __pyx_v_eN;
16686 __pyx_t_11 = __pyx_v_k;
16688 if (__pyx_t_10 < 0) {
16689 __pyx_t_10 += __pyx_pybuffernd_dV.diminfo[0].shape;
16690 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
16691 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16692 if (__pyx_t_11 < 0) {
16693 __pyx_t_11 += __pyx_pybuffernd_dV.diminfo[1].shape;
16694 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
16695 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16696 if (unlikely(__pyx_t_9 != -1)) {
16697 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16698 __PYX_ERR(0, 770, __pyx_L1_error)
16700 __pyx_t_12 = __pyx_v_eN;
16701 __pyx_t_13 = __pyx_v_k;
16703 if (__pyx_t_12 < 0) {
16704 __pyx_t_12 += __pyx_pybuffernd_dm.diminfo[0].shape;
16705 if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 0;
16706 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_dm.diminfo[0].shape)) __pyx_t_9 = 0;
16707 if (__pyx_t_13 < 0) {
16708 __pyx_t_13 += __pyx_pybuffernd_dm.diminfo[1].shape;
16709 if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 1;
16710 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_dm.diminfo[1].shape)) __pyx_t_9 = 1;
16711 if (unlikely(__pyx_t_9 != -1)) {
16712 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16713 __PYX_ERR(0, 770, __pyx_L1_error)
16715 __pyx_v_omega_e = (__pyx_v_omega_e + ((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dm.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_dm.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_dm.diminfo[1].strides))));
16725 __pyx_t_4 = (__pyx_v_l2g->dimensions[1]);
16726 __pyx_t_5 = __pyx_t_4;
16727 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16728 __pyx_v_j = __pyx_t_6;
16737 __pyx_t_14 = __pyx_v_eN;
16738 __pyx_t_15 = __pyx_v_j;
16740 if (__pyx_t_14 < 0) {
16741 __pyx_t_14 += __pyx_pybuffernd_l2g.diminfo[0].shape;
16742 if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0;
16743 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_l2g.diminfo[0].shape)) __pyx_t_9 = 0;
16744 if (__pyx_t_15 < 0) {
16745 __pyx_t_15 += __pyx_pybuffernd_l2g.diminfo[1].shape;
16746 if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 1;
16747 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_l2g.diminfo[1].shape)) __pyx_t_9 = 1;
16748 if (unlikely(__pyx_t_9 != -1)) {
16749 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16750 __PYX_ERR(0, 772, __pyx_L1_error)
16752 __pyx_v_J = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_l2g.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_l2g.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_l2g.diminfo[1].strides));
16761 __pyx_t_16 = __pyx_v_J;
16763 if (__pyx_t_16 < 0) {
16764 __pyx_t_16 += __pyx_pybuffernd_df_dofs.diminfo[0].shape;
16765 if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0;
16766 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_df_dofs.diminfo[0].shape)) __pyx_t_9 = 0;
16767 if (unlikely(__pyx_t_9 != -1)) {
16768 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16769 __PYX_ERR(0, 773, __pyx_L1_error)
16771 __pyx_t_17 = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_df_dofs.diminfo[0].strides)) * __pyx_v_vol_e);
16772 __pyx_t_18 = (__pyx_v_omega_e + 1.0e-12);
16773 if (unlikely(__pyx_t_18 == 0)) {
16774 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
16775 __PYX_ERR(0, 773, __pyx_L1_error)
16777 __pyx_t_19 = __pyx_v_J;
16779 if (__pyx_t_19 < 0) {
16780 __pyx_t_19 += __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape;
16781 if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0;
16782 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape)) __pyx_t_9 = 0;
16783 if (unlikely(__pyx_t_9 != -1)) {
16784 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16785 __PYX_ERR(0, 773, __pyx_L1_error)
16787 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].strides) = (__pyx_t_17 / __pyx_t_18);
16800 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16803 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
16804 __Pyx_PyThreadState_declare
16805 __Pyx_PyThreadState_assign
16806 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
16807 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer);
16808 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16809 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer);
16810 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16811 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer);
16812 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
16813 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromVelocityDOFs", __pyx_clineno, __pyx_lineno, __pyx_filename);
16817 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer);
16818 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16819 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer);
16820 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16821 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer);
16823 __Pyx_XGIVEREF(__pyx_r);
16824 __Pyx_RefNannyFinishContext();
16837 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16838 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3 = {
"rotatingGaussianElementVelocityEval3", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
16839 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16840 int __pyx_v_transient;
16842 double __pyx_v_tForReversal;
16843 double __pyx_v_clock;
16846 PyArrayObject *__pyx_v_x = 0;
16847 PyArrayObject *__pyx_v_v = 0;
16848 double __pyx_v_zvelocity;
16849 PyObject *__pyx_r = 0;
16850 __Pyx_RefNannyDeclarations
16851 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval3 (wrapper)", 0);
16853 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_zvelocity,0};
16854 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
16855 if (unlikely(__pyx_kwds)) {
16856 Py_ssize_t kw_args;
16857 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16858 switch (pos_args) {
16859 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
16860 CYTHON_FALLTHROUGH;
16861 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
16862 CYTHON_FALLTHROUGH;
16863 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
16864 CYTHON_FALLTHROUGH;
16865 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
16866 CYTHON_FALLTHROUGH;
16867 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16868 CYTHON_FALLTHROUGH;
16869 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16870 CYTHON_FALLTHROUGH;
16871 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16872 CYTHON_FALLTHROUGH;
16873 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16874 CYTHON_FALLTHROUGH;
16875 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16876 CYTHON_FALLTHROUGH;
16878 default:
goto __pyx_L5_argtuple_error;
16880 kw_args = PyDict_Size(__pyx_kwds);
16881 switch (pos_args) {
16883 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
16884 else goto __pyx_L5_argtuple_error;
16885 CYTHON_FALLTHROUGH;
16887 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
16889 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 1); __PYX_ERR(0, 776, __pyx_L3_error)
16891 CYTHON_FALLTHROUGH;
16893 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
16895 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 2); __PYX_ERR(0, 776, __pyx_L3_error)
16897 CYTHON_FALLTHROUGH;
16899 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
16901 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 3); __PYX_ERR(0, 776, __pyx_L3_error)
16903 CYTHON_FALLTHROUGH;
16905 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
16907 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 4); __PYX_ERR(0, 776, __pyx_L3_error)
16909 CYTHON_FALLTHROUGH;
16911 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
16913 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 5); __PYX_ERR(0, 776, __pyx_L3_error)
16915 CYTHON_FALLTHROUGH;
16917 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
16919 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 6); __PYX_ERR(0, 776, __pyx_L3_error)
16921 CYTHON_FALLTHROUGH;
16923 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
16925 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 7); __PYX_ERR(0, 776, __pyx_L3_error)
16927 CYTHON_FALLTHROUGH;
16930 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zvelocity);
16931 if (value) { values[8] = value; kw_args--; }
16934 if (unlikely(kw_args > 0)) {
16935 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"rotatingGaussianElementVelocityEval3") < 0)) __PYX_ERR(0, 776, __pyx_L3_error)
16938 switch (PyTuple_GET_SIZE(__pyx_args)) {
16939 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
16940 CYTHON_FALLTHROUGH;
16941 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
16942 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
16943 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
16944 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16945 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16946 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16947 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16948 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16950 default:
goto __pyx_L5_argtuple_error;
16953 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L3_error)
16954 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 777, __pyx_L3_error)
16955 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 778, __pyx_L3_error)
16956 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 779, __pyx_L3_error)
16957 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L3_error)
16958 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L3_error)
16959 __pyx_v_x = ((PyArrayObject *)values[6]);
16960 __pyx_v_v = ((PyArrayObject *)values[7]);
16962 __pyx_v_zvelocity = __pyx_PyFloat_AsDouble(values[8]);
if (unlikely((__pyx_v_zvelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 783, __pyx_L3_error)
16964 __pyx_v_zvelocity = ((double)0.0);
16967 goto __pyx_L4_argument_unpacking_done;
16968 __pyx_L5_argtuple_error:;
16969 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 776, __pyx_L3_error)
16971 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
16972 __Pyx_RefNannyFinishContext();
16974 __pyx_L4_argument_unpacking_done:;
16975 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 781, __pyx_L1_error)
16976 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 782, __pyx_L1_error)
16977 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v, __pyx_v_zvelocity);
16984 __Pyx_RefNannyFinishContext();
16988 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity) {
16992 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
16993 __Pyx_Buffer __pyx_pybuffer_v;
16994 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
16995 __Pyx_Buffer __pyx_pybuffer_x;
16996 PyObject *__pyx_r = NULL;
16997 __Pyx_RefNannyDeclarations
16999 npy_intp __pyx_t_2;
17000 npy_intp __pyx_t_3;
17002 npy_intp __pyx_t_5;
17003 npy_intp __pyx_t_6;
17005 Py_ssize_t __pyx_t_8;
17006 Py_ssize_t __pyx_t_9;
17007 Py_ssize_t __pyx_t_10;
17009 Py_ssize_t __pyx_t_12;
17010 Py_ssize_t __pyx_t_13;
17011 Py_ssize_t __pyx_t_14;
17012 Py_ssize_t __pyx_t_15;
17013 Py_ssize_t __pyx_t_16;
17014 Py_ssize_t __pyx_t_17;
17015 Py_ssize_t __pyx_t_18;
17016 Py_ssize_t __pyx_t_19;
17017 Py_ssize_t __pyx_t_20;
17018 Py_ssize_t __pyx_t_21;
17019 Py_ssize_t __pyx_t_22;
17020 Py_ssize_t __pyx_t_23;
17021 PyObject *__pyx_t_24 = NULL;
17022 PyObject *__pyx_t_25 = NULL;
17023 PyObject *__pyx_t_26 = NULL;
17026 PyObject *__pyx_t_29 = NULL;
17027 Py_ssize_t __pyx_t_30;
17028 Py_ssize_t __pyx_t_31;
17029 Py_ssize_t __pyx_t_32;
17030 Py_ssize_t __pyx_t_33;
17031 Py_ssize_t __pyx_t_34;
17032 Py_ssize_t __pyx_t_35;
17033 Py_ssize_t __pyx_t_36;
17034 Py_ssize_t __pyx_t_37;
17035 Py_ssize_t __pyx_t_38;
17036 Py_ssize_t __pyx_t_39;
17037 Py_ssize_t __pyx_t_40;
17038 Py_ssize_t __pyx_t_41;
17039 Py_ssize_t __pyx_t_42;
17040 Py_ssize_t __pyx_t_43;
17041 Py_ssize_t __pyx_t_44;
17042 Py_ssize_t __pyx_t_45;
17043 Py_ssize_t __pyx_t_46;
17044 Py_ssize_t __pyx_t_47;
17045 Py_ssize_t __pyx_t_48;
17046 Py_ssize_t __pyx_t_49;
17047 Py_ssize_t __pyx_t_50;
17048 Py_ssize_t __pyx_t_51;
17049 Py_ssize_t __pyx_t_52;
17050 Py_ssize_t __pyx_t_53;
17051 Py_ssize_t __pyx_t_54;
17052 Py_ssize_t __pyx_t_55;
17053 Py_ssize_t __pyx_t_56;
17054 Py_ssize_t __pyx_t_57;
17055 Py_ssize_t __pyx_t_58;
17056 Py_ssize_t __pyx_t_59;
17057 Py_ssize_t __pyx_t_60;
17058 Py_ssize_t __pyx_t_61;
17059 Py_ssize_t __pyx_t_62;
17060 Py_ssize_t __pyx_t_63;
17061 Py_ssize_t __pyx_t_64;
17062 Py_ssize_t __pyx_t_65;
17063 Py_ssize_t __pyx_t_66;
17064 Py_ssize_t __pyx_t_67;
17065 Py_ssize_t __pyx_t_68;
17066 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval3", 0);
17067 __pyx_pybuffer_x.pybuffer.buf = NULL;
17068 __pyx_pybuffer_x.refcount = 0;
17069 __pyx_pybuffernd_x.data = NULL;
17070 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
17071 __pyx_pybuffer_v.pybuffer.buf = NULL;
17072 __pyx_pybuffer_v.refcount = 0;
17073 __pyx_pybuffernd_v.data = NULL;
17074 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
17076 __Pyx_BufFmt_StackElem __pyx_stack[1];
17077 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 776, __pyx_L1_error)
17079 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
17081 __Pyx_BufFmt_StackElem __pyx_stack[1];
17082 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 776, __pyx_L1_error)
17084 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
17102 __pyx_t_1 = (((__pyx_v_v->dimensions[2]) == 3) != 0);
17112 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
17122 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17123 __pyx_t_3 = __pyx_t_2;
17124 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17125 __pyx_v_eN = __pyx_t_4;
17134 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17135 __pyx_t_6 = __pyx_t_5;
17136 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17137 __pyx_v_k = __pyx_t_7;
17146 __pyx_t_8 = __pyx_v_eN;
17147 __pyx_t_9 = __pyx_v_k;
17150 if (__pyx_t_8 < 0) {
17151 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
17152 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
17153 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17154 if (__pyx_t_9 < 0) {
17155 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17156 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17157 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17158 if (__pyx_t_10 < 0) {
17159 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
17160 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
17161 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17162 if (unlikely(__pyx_t_11 != -1)) {
17163 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17164 __PYX_ERR(0, 791, __pyx_L1_error)
17166 __pyx_t_12 = __pyx_v_eN;
17167 __pyx_t_13 = __pyx_v_k;
17170 if (__pyx_t_12 < 0) {
17171 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
17172 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
17173 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17174 if (__pyx_t_13 < 0) {
17175 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17176 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17177 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17178 if (__pyx_t_14 < 0) {
17179 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
17180 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
17181 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17182 if (unlikely(__pyx_t_11 != -1)) {
17183 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17184 __PYX_ERR(0, 791, __pyx_L1_error)
17186 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17195 __pyx_t_15 = __pyx_v_eN;
17196 __pyx_t_16 = __pyx_v_k;
17199 if (__pyx_t_15 < 0) {
17200 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[0].shape;
17201 if (unlikely(__pyx_t_15 < 0)) __pyx_t_11 = 0;
17202 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17203 if (__pyx_t_16 < 0) {
17204 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[1].shape;
17205 if (unlikely(__pyx_t_16 < 0)) __pyx_t_11 = 1;
17206 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17207 if (__pyx_t_17 < 0) {
17208 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[2].shape;
17209 if (unlikely(__pyx_t_17 < 0)) __pyx_t_11 = 2;
17210 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17211 if (unlikely(__pyx_t_11 != -1)) {
17212 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17213 __PYX_ERR(0, 792, __pyx_L1_error)
17215 __pyx_t_18 = __pyx_v_eN;
17216 __pyx_t_19 = __pyx_v_k;
17219 if (__pyx_t_18 < 0) {
17220 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[0].shape;
17221 if (unlikely(__pyx_t_18 < 0)) __pyx_t_11 = 0;
17222 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17223 if (__pyx_t_19 < 0) {
17224 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[1].shape;
17225 if (unlikely(__pyx_t_19 < 0)) __pyx_t_11 = 1;
17226 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17227 if (__pyx_t_20 < 0) {
17228 __pyx_t_20 += __pyx_pybuffernd_v.diminfo[2].shape;
17229 if (unlikely(__pyx_t_20 < 0)) __pyx_t_11 = 2;
17230 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17231 if (unlikely(__pyx_t_11 != -1)) {
17232 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17233 __PYX_ERR(0, 792, __pyx_L1_error)
17235 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_x.diminfo[2].strides))));
17244 __pyx_t_21 = __pyx_v_eN;
17245 __pyx_t_22 = __pyx_v_k;
17248 if (__pyx_t_21 < 0) {
17249 __pyx_t_21 += __pyx_pybuffernd_v.diminfo[0].shape;
17250 if (unlikely(__pyx_t_21 < 0)) __pyx_t_11 = 0;
17251 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17252 if (__pyx_t_22 < 0) {
17253 __pyx_t_22 += __pyx_pybuffernd_v.diminfo[1].shape;
17254 if (unlikely(__pyx_t_22 < 0)) __pyx_t_11 = 1;
17255 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17256 if (__pyx_t_23 < 0) {
17257 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[2].shape;
17258 if (unlikely(__pyx_t_23 < 0)) __pyx_t_11 = 2;
17259 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17260 if (unlikely(__pyx_t_11 != -1)) {
17261 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17262 __PYX_ERR(0, 793, __pyx_L1_error)
17264 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zvelocity;
17273 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 794, __pyx_L1_error)
17274 __Pyx_GOTREF(__pyx_t_24);
17275 __pyx_t_25 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 794, __pyx_L1_error)
17276 __Pyx_GOTREF(__pyx_t_25);
17277 __pyx_t_26 = PyTuple_New(3);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 794, __pyx_L1_error)
17278 __Pyx_GOTREF(__pyx_t_26);
17279 __Pyx_GIVEREF(__pyx_t_24);
17280 PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_24);
17281 __Pyx_GIVEREF(__pyx_t_25);
17282 PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_t_25);
17283 __Pyx_INCREF(__pyx_slice_);
17284 __Pyx_GIVEREF(__pyx_slice_);
17285 PyTuple_SET_ITEM(__pyx_t_26, 2, __pyx_slice_);
17288 __pyx_t_25 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_26);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 794, __pyx_L1_error)
17289 __Pyx_GOTREF(__pyx_t_25);
17290 __pyx_t_27 = (__pyx_v_tForReversal - __pyx_v_t);
17291 __pyx_t_28 = (__pyx_v_tForReversal - 0.0);
17292 if (unlikely(__pyx_t_28 == 0)) {
17293 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
17294 __PYX_ERR(0, 794, __pyx_L1_error)
17296 __pyx_t_24 = PyFloat_FromDouble(((__pyx_t_27 / __pyx_t_28) * __pyx_v_clock));
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 794, __pyx_L1_error)
17297 __Pyx_GOTREF(__pyx_t_24);
17298 __pyx_t_29 = PyNumber_InPlaceMultiply(__pyx_t_25, __pyx_t_24);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 794, __pyx_L1_error)
17299 __Pyx_GOTREF(__pyx_t_29);
17300 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
17301 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
17302 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_26, __pyx_t_29) < 0)) __PYX_ERR(0, 794, __pyx_L1_error)
17303 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
17304 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
17326 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17327 __pyx_t_3 = __pyx_t_2;
17328 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17329 __pyx_v_eN = __pyx_t_4;
17338 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17339 __pyx_t_6 = __pyx_t_5;
17340 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17341 __pyx_v_k = __pyx_t_7;
17350 __pyx_t_30 = __pyx_v_eN;
17351 __pyx_t_31 = __pyx_v_k;
17354 if (__pyx_t_30 < 0) {
17355 __pyx_t_30 += __pyx_pybuffernd_x.diminfo[0].shape;
17356 if (unlikely(__pyx_t_30 < 0)) __pyx_t_11 = 0;
17357 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17358 if (__pyx_t_31 < 0) {
17359 __pyx_t_31 += __pyx_pybuffernd_x.diminfo[1].shape;
17360 if (unlikely(__pyx_t_31 < 0)) __pyx_t_11 = 1;
17361 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17362 if (__pyx_t_32 < 0) {
17363 __pyx_t_32 += __pyx_pybuffernd_x.diminfo[2].shape;
17364 if (unlikely(__pyx_t_32 < 0)) __pyx_t_11 = 2;
17365 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17366 if (unlikely(__pyx_t_11 != -1)) {
17367 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17368 __PYX_ERR(0, 798, __pyx_L1_error)
17370 __pyx_t_33 = __pyx_v_eN;
17371 __pyx_t_34 = __pyx_v_k;
17374 if (__pyx_t_33 < 0) {
17375 __pyx_t_33 += __pyx_pybuffernd_v.diminfo[0].shape;
17376 if (unlikely(__pyx_t_33 < 0)) __pyx_t_11 = 0;
17377 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17378 if (__pyx_t_34 < 0) {
17379 __pyx_t_34 += __pyx_pybuffernd_v.diminfo[1].shape;
17380 if (unlikely(__pyx_t_34 < 0)) __pyx_t_11 = 1;
17381 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17382 if (__pyx_t_35 < 0) {
17383 __pyx_t_35 += __pyx_pybuffernd_v.diminfo[2].shape;
17384 if (unlikely(__pyx_t_35 < 0)) __pyx_t_11 = 2;
17385 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17386 if (unlikely(__pyx_t_11 != -1)) {
17387 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17388 __PYX_ERR(0, 798, __pyx_L1_error)
17390 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_35, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_32, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17399 __pyx_t_36 = __pyx_v_eN;
17400 __pyx_t_37 = __pyx_v_k;
17403 if (__pyx_t_36 < 0) {
17404 __pyx_t_36 += __pyx_pybuffernd_x.diminfo[0].shape;
17405 if (unlikely(__pyx_t_36 < 0)) __pyx_t_11 = 0;
17406 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17407 if (__pyx_t_37 < 0) {
17408 __pyx_t_37 += __pyx_pybuffernd_x.diminfo[1].shape;
17409 if (unlikely(__pyx_t_37 < 0)) __pyx_t_11 = 1;
17410 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17411 if (__pyx_t_38 < 0) {
17412 __pyx_t_38 += __pyx_pybuffernd_x.diminfo[2].shape;
17413 if (unlikely(__pyx_t_38 < 0)) __pyx_t_11 = 2;
17414 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17415 if (unlikely(__pyx_t_11 != -1)) {
17416 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17417 __PYX_ERR(0, 799, __pyx_L1_error)
17419 __pyx_t_39 = __pyx_v_eN;
17420 __pyx_t_40 = __pyx_v_k;
17423 if (__pyx_t_39 < 0) {
17424 __pyx_t_39 += __pyx_pybuffernd_v.diminfo[0].shape;
17425 if (unlikely(__pyx_t_39 < 0)) __pyx_t_11 = 0;
17426 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17427 if (__pyx_t_40 < 0) {
17428 __pyx_t_40 += __pyx_pybuffernd_v.diminfo[1].shape;
17429 if (unlikely(__pyx_t_40 < 0)) __pyx_t_11 = 1;
17430 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17431 if (__pyx_t_41 < 0) {
17432 __pyx_t_41 += __pyx_pybuffernd_v.diminfo[2].shape;
17433 if (unlikely(__pyx_t_41 < 0)) __pyx_t_11 = 2;
17434 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17435 if (unlikely(__pyx_t_11 != -1)) {
17436 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17437 __PYX_ERR(0, 799, __pyx_L1_error)
17439 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_41, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_38, __pyx_pybuffernd_x.diminfo[2].strides))));
17448 __pyx_t_42 = __pyx_v_eN;
17449 __pyx_t_43 = __pyx_v_k;
17452 if (__pyx_t_42 < 0) {
17453 __pyx_t_42 += __pyx_pybuffernd_v.diminfo[0].shape;
17454 if (unlikely(__pyx_t_42 < 0)) __pyx_t_11 = 0;
17455 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17456 if (__pyx_t_43 < 0) {
17457 __pyx_t_43 += __pyx_pybuffernd_v.diminfo[1].shape;
17458 if (unlikely(__pyx_t_43 < 0)) __pyx_t_11 = 1;
17459 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17460 if (__pyx_t_44 < 0) {
17461 __pyx_t_44 += __pyx_pybuffernd_v.diminfo[2].shape;
17462 if (unlikely(__pyx_t_44 < 0)) __pyx_t_11 = 2;
17463 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17464 if (unlikely(__pyx_t_11 != -1)) {
17465 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17466 __PYX_ERR(0, 800, __pyx_L1_error)
17468 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_44, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zvelocity;
17492 #ifndef CYTHON_WITHOUT_ASSERTIONS 17493 if (unlikely(!Py_OptimizeFlag)) {
17494 if (unlikely(!(((__pyx_v_v->dimensions[2]) == 2) != 0))) {
17495 PyErr_SetNone(PyExc_AssertionError);
17496 __PYX_ERR(0, 802, __pyx_L1_error)
17508 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
17518 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17519 __pyx_t_3 = __pyx_t_2;
17520 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17521 __pyx_v_eN = __pyx_t_4;
17530 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17531 __pyx_t_6 = __pyx_t_5;
17532 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17533 __pyx_v_k = __pyx_t_7;
17542 __pyx_t_45 = __pyx_v_eN;
17543 __pyx_t_46 = __pyx_v_k;
17546 if (__pyx_t_45 < 0) {
17547 __pyx_t_45 += __pyx_pybuffernd_x.diminfo[0].shape;
17548 if (unlikely(__pyx_t_45 < 0)) __pyx_t_11 = 0;
17549 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17550 if (__pyx_t_46 < 0) {
17551 __pyx_t_46 += __pyx_pybuffernd_x.diminfo[1].shape;
17552 if (unlikely(__pyx_t_46 < 0)) __pyx_t_11 = 1;
17553 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17554 if (__pyx_t_47 < 0) {
17555 __pyx_t_47 += __pyx_pybuffernd_x.diminfo[2].shape;
17556 if (unlikely(__pyx_t_47 < 0)) __pyx_t_11 = 2;
17557 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17558 if (unlikely(__pyx_t_11 != -1)) {
17559 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17560 __PYX_ERR(0, 806, __pyx_L1_error)
17562 __pyx_t_48 = __pyx_v_eN;
17563 __pyx_t_49 = __pyx_v_k;
17566 if (__pyx_t_48 < 0) {
17567 __pyx_t_48 += __pyx_pybuffernd_v.diminfo[0].shape;
17568 if (unlikely(__pyx_t_48 < 0)) __pyx_t_11 = 0;
17569 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17570 if (__pyx_t_49 < 0) {
17571 __pyx_t_49 += __pyx_pybuffernd_v.diminfo[1].shape;
17572 if (unlikely(__pyx_t_49 < 0)) __pyx_t_11 = 1;
17573 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17574 if (__pyx_t_50 < 0) {
17575 __pyx_t_50 += __pyx_pybuffernd_v.diminfo[2].shape;
17576 if (unlikely(__pyx_t_50 < 0)) __pyx_t_11 = 2;
17577 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17578 if (unlikely(__pyx_t_11 != -1)) {
17579 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17580 __PYX_ERR(0, 806, __pyx_L1_error)
17582 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_50, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_47, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17591 __pyx_t_51 = __pyx_v_eN;
17592 __pyx_t_52 = __pyx_v_k;
17595 if (__pyx_t_51 < 0) {
17596 __pyx_t_51 += __pyx_pybuffernd_x.diminfo[0].shape;
17597 if (unlikely(__pyx_t_51 < 0)) __pyx_t_11 = 0;
17598 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17599 if (__pyx_t_52 < 0) {
17600 __pyx_t_52 += __pyx_pybuffernd_x.diminfo[1].shape;
17601 if (unlikely(__pyx_t_52 < 0)) __pyx_t_11 = 1;
17602 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17603 if (__pyx_t_53 < 0) {
17604 __pyx_t_53 += __pyx_pybuffernd_x.diminfo[2].shape;
17605 if (unlikely(__pyx_t_53 < 0)) __pyx_t_11 = 2;
17606 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17607 if (unlikely(__pyx_t_11 != -1)) {
17608 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17609 __PYX_ERR(0, 807, __pyx_L1_error)
17611 __pyx_t_54 = __pyx_v_eN;
17612 __pyx_t_55 = __pyx_v_k;
17615 if (__pyx_t_54 < 0) {
17616 __pyx_t_54 += __pyx_pybuffernd_v.diminfo[0].shape;
17617 if (unlikely(__pyx_t_54 < 0)) __pyx_t_11 = 0;
17618 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17619 if (__pyx_t_55 < 0) {
17620 __pyx_t_55 += __pyx_pybuffernd_v.diminfo[1].shape;
17621 if (unlikely(__pyx_t_55 < 0)) __pyx_t_11 = 1;
17622 }
else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17623 if (__pyx_t_56 < 0) {
17624 __pyx_t_56 += __pyx_pybuffernd_v.diminfo[2].shape;
17625 if (unlikely(__pyx_t_56 < 0)) __pyx_t_11 = 2;
17626 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17627 if (unlikely(__pyx_t_11 != -1)) {
17628 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17629 __PYX_ERR(0, 807, __pyx_L1_error)
17631 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_55, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_56, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_53, __pyx_pybuffernd_x.diminfo[2].strides))));
17640 __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 808, __pyx_L1_error)
17641 __Pyx_GOTREF(__pyx_t_26);
17642 __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 808, __pyx_L1_error)
17643 __Pyx_GOTREF(__pyx_t_29);
17644 __pyx_t_24 = PyTuple_New(3);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 808, __pyx_L1_error)
17645 __Pyx_GOTREF(__pyx_t_24);
17646 __Pyx_GIVEREF(__pyx_t_26);
17647 PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_26);
17648 __Pyx_GIVEREF(__pyx_t_29);
17649 PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_29);
17650 __Pyx_INCREF(__pyx_slice_);
17651 __Pyx_GIVEREF(__pyx_slice_);
17652 PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_slice_);
17655 __pyx_t_29 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_24);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 808, __pyx_L1_error)
17656 __Pyx_GOTREF(__pyx_t_29);
17657 __pyx_t_28 = (__pyx_v_tForReversal - __pyx_v_t);
17658 __pyx_t_27 = (__pyx_v_tForReversal - 0.0);
17659 if (unlikely(__pyx_t_27 == 0)) {
17660 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
17661 __PYX_ERR(0, 808, __pyx_L1_error)
17663 __pyx_t_26 = PyFloat_FromDouble(((__pyx_t_28 / __pyx_t_27) * __pyx_v_clock));
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 808, __pyx_L1_error)
17664 __Pyx_GOTREF(__pyx_t_26);
17665 __pyx_t_25 = PyNumber_InPlaceMultiply(__pyx_t_29, __pyx_t_26);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 808, __pyx_L1_error)
17666 __Pyx_GOTREF(__pyx_t_25);
17667 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
17668 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
17669 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_24, __pyx_t_25) < 0)) __PYX_ERR(0, 808, __pyx_L1_error)
17670 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
17671 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
17693 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17694 __pyx_t_3 = __pyx_t_2;
17695 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17696 __pyx_v_eN = __pyx_t_4;
17705 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17706 __pyx_t_6 = __pyx_t_5;
17707 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17708 __pyx_v_k = __pyx_t_7;
17717 __pyx_t_57 = __pyx_v_eN;
17718 __pyx_t_58 = __pyx_v_k;
17721 if (__pyx_t_57 < 0) {
17722 __pyx_t_57 += __pyx_pybuffernd_x.diminfo[0].shape;
17723 if (unlikely(__pyx_t_57 < 0)) __pyx_t_11 = 0;
17724 }
else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17725 if (__pyx_t_58 < 0) {
17726 __pyx_t_58 += __pyx_pybuffernd_x.diminfo[1].shape;
17727 if (unlikely(__pyx_t_58 < 0)) __pyx_t_11 = 1;
17728 }
else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17729 if (__pyx_t_59 < 0) {
17730 __pyx_t_59 += __pyx_pybuffernd_x.diminfo[2].shape;
17731 if (unlikely(__pyx_t_59 < 0)) __pyx_t_11 = 2;
17732 }
else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17733 if (unlikely(__pyx_t_11 != -1)) {
17734 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17735 __PYX_ERR(0, 812, __pyx_L1_error)
17737 __pyx_t_60 = __pyx_v_eN;
17738 __pyx_t_61 = __pyx_v_k;
17741 if (__pyx_t_60 < 0) {
17742 __pyx_t_60 += __pyx_pybuffernd_v.diminfo[0].shape;
17743 if (unlikely(__pyx_t_60 < 0)) __pyx_t_11 = 0;
17744 }
else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17745 if (__pyx_t_61 < 0) {
17746 __pyx_t_61 += __pyx_pybuffernd_v.diminfo[1].shape;
17747 if (unlikely(__pyx_t_61 < 0)) __pyx_t_11 = 1;
17748 }
else if (unlikely(__pyx_t_61 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17749 if (__pyx_t_62 < 0) {
17750 __pyx_t_62 += __pyx_pybuffernd_v.diminfo[2].shape;
17751 if (unlikely(__pyx_t_62 < 0)) __pyx_t_11 = 2;
17752 }
else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17753 if (unlikely(__pyx_t_11 != -1)) {
17754 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17755 __PYX_ERR(0, 812, __pyx_L1_error)
17757 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_61, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_62, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_58, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_59, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17766 __pyx_t_63 = __pyx_v_eN;
17767 __pyx_t_64 = __pyx_v_k;
17770 if (__pyx_t_63 < 0) {
17771 __pyx_t_63 += __pyx_pybuffernd_x.diminfo[0].shape;
17772 if (unlikely(__pyx_t_63 < 0)) __pyx_t_11 = 0;
17773 }
else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17774 if (__pyx_t_64 < 0) {
17775 __pyx_t_64 += __pyx_pybuffernd_x.diminfo[1].shape;
17776 if (unlikely(__pyx_t_64 < 0)) __pyx_t_11 = 1;
17777 }
else if (unlikely(__pyx_t_64 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17778 if (__pyx_t_65 < 0) {
17779 __pyx_t_65 += __pyx_pybuffernd_x.diminfo[2].shape;
17780 if (unlikely(__pyx_t_65 < 0)) __pyx_t_11 = 2;
17781 }
else if (unlikely(__pyx_t_65 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17782 if (unlikely(__pyx_t_11 != -1)) {
17783 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17784 __PYX_ERR(0, 813, __pyx_L1_error)
17786 __pyx_t_66 = __pyx_v_eN;
17787 __pyx_t_67 = __pyx_v_k;
17790 if (__pyx_t_66 < 0) {
17791 __pyx_t_66 += __pyx_pybuffernd_v.diminfo[0].shape;
17792 if (unlikely(__pyx_t_66 < 0)) __pyx_t_11 = 0;
17793 }
else if (unlikely(__pyx_t_66 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17794 if (__pyx_t_67 < 0) {
17795 __pyx_t_67 += __pyx_pybuffernd_v.diminfo[1].shape;
17796 if (unlikely(__pyx_t_67 < 0)) __pyx_t_11 = 1;
17797 }
else if (unlikely(__pyx_t_67 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17798 if (__pyx_t_68 < 0) {
17799 __pyx_t_68 += __pyx_pybuffernd_v.diminfo[2].shape;
17800 if (unlikely(__pyx_t_68 < 0)) __pyx_t_11 = 2;
17801 }
else if (unlikely(__pyx_t_68 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17802 if (unlikely(__pyx_t_11 != -1)) {
17803 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17804 __PYX_ERR(0, 813, __pyx_L1_error)
17806 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_66, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_67, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_68, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_64, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_65, __pyx_pybuffernd_x.diminfo[2].strides))));
17823 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17826 __Pyx_XDECREF(__pyx_t_24);
17827 __Pyx_XDECREF(__pyx_t_25);
17828 __Pyx_XDECREF(__pyx_t_26);
17829 __Pyx_XDECREF(__pyx_t_29);
17830 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
17831 __Pyx_PyThreadState_declare
17832 __Pyx_PyThreadState_assign
17833 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
17834 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
17835 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
17836 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
17837 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17841 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
17842 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
17844 __Pyx_XGIVEREF(__pyx_r);
17845 __Pyx_RefNannyFinishContext();
17858 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17859 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4 = {
"rotatingGaussianElementVelocityEval4", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
17860 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17861 int __pyx_v_transient;
17863 double __pyx_v_tForReversal;
17864 double __pyx_v_clock;
17867 PyArrayObject *__pyx_v_x = 0;
17868 PyArrayObject *__pyx_v_v = 0;
17869 double __pyx_v_zvelocity;
17870 PyObject *__pyx_r = 0;
17871 __Pyx_RefNannyDeclarations
17872 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval4 (wrapper)", 0);
17874 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_zvelocity,0};
17875 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
17876 if (unlikely(__pyx_kwds)) {
17877 Py_ssize_t kw_args;
17878 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17879 switch (pos_args) {
17880 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
17881 CYTHON_FALLTHROUGH;
17882 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
17883 CYTHON_FALLTHROUGH;
17884 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
17885 CYTHON_FALLTHROUGH;
17886 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
17887 CYTHON_FALLTHROUGH;
17888 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17889 CYTHON_FALLTHROUGH;
17890 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17891 CYTHON_FALLTHROUGH;
17892 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17893 CYTHON_FALLTHROUGH;
17894 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17895 CYTHON_FALLTHROUGH;
17896 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17897 CYTHON_FALLTHROUGH;
17899 default:
goto __pyx_L5_argtuple_error;
17901 kw_args = PyDict_Size(__pyx_kwds);
17902 switch (pos_args) {
17904 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
17905 else goto __pyx_L5_argtuple_error;
17906 CYTHON_FALLTHROUGH;
17908 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
17910 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 1); __PYX_ERR(0, 816, __pyx_L3_error)
17912 CYTHON_FALLTHROUGH;
17914 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
17916 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 2); __PYX_ERR(0, 816, __pyx_L3_error)
17918 CYTHON_FALLTHROUGH;
17920 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
17922 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 3); __PYX_ERR(0, 816, __pyx_L3_error)
17924 CYTHON_FALLTHROUGH;
17926 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
17928 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 4); __PYX_ERR(0, 816, __pyx_L3_error)
17930 CYTHON_FALLTHROUGH;
17932 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
17934 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 5); __PYX_ERR(0, 816, __pyx_L3_error)
17936 CYTHON_FALLTHROUGH;
17938 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
17940 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 6); __PYX_ERR(0, 816, __pyx_L3_error)
17942 CYTHON_FALLTHROUGH;
17944 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
17946 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 7); __PYX_ERR(0, 816, __pyx_L3_error)
17948 CYTHON_FALLTHROUGH;
17951 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zvelocity);
17952 if (value) { values[8] = value; kw_args--; }
17955 if (unlikely(kw_args > 0)) {
17956 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"rotatingGaussianElementVelocityEval4") < 0)) __PYX_ERR(0, 816, __pyx_L3_error)
17959 switch (PyTuple_GET_SIZE(__pyx_args)) {
17960 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
17961 CYTHON_FALLTHROUGH;
17962 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
17963 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
17964 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
17965 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17966 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17967 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17968 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17969 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17971 default:
goto __pyx_L5_argtuple_error;
17974 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 816, __pyx_L3_error)
17975 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 817, __pyx_L3_error)
17976 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 818, __pyx_L3_error)
17977 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 819, __pyx_L3_error)
17978 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error)
17979 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error)
17980 __pyx_v_x = ((PyArrayObject *)values[6]);
17981 __pyx_v_v = ((PyArrayObject *)values[7]);
17983 __pyx_v_zvelocity = __pyx_PyFloat_AsDouble(values[8]);
if (unlikely((__pyx_v_zvelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 823, __pyx_L3_error)
17985 __pyx_v_zvelocity = ((double)0.0);
17988 goto __pyx_L4_argument_unpacking_done;
17989 __pyx_L5_argtuple_error:;
17990 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 816, __pyx_L3_error)
17992 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
17993 __Pyx_RefNannyFinishContext();
17995 __pyx_L4_argument_unpacking_done:;
17996 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 821, __pyx_L1_error)
17997 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 822, __pyx_L1_error)
17998 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v, __pyx_v_zvelocity);
18005 __Pyx_RefNannyFinishContext();
18009 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity) {
18014 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
18015 __Pyx_Buffer __pyx_pybuffer_v;
18016 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
18017 __Pyx_Buffer __pyx_pybuffer_x;
18018 PyObject *__pyx_r = NULL;
18019 __Pyx_RefNannyDeclarations
18021 npy_intp __pyx_t_2;
18022 npy_intp __pyx_t_3;
18024 npy_intp __pyx_t_5;
18025 npy_intp __pyx_t_6;
18027 npy_intp __pyx_t_8;
18028 npy_intp __pyx_t_9;
18030 Py_ssize_t __pyx_t_11;
18031 Py_ssize_t __pyx_t_12;
18032 Py_ssize_t __pyx_t_13;
18033 Py_ssize_t __pyx_t_14;
18035 Py_ssize_t __pyx_t_16;
18036 Py_ssize_t __pyx_t_17;
18037 Py_ssize_t __pyx_t_18;
18038 Py_ssize_t __pyx_t_19;
18039 Py_ssize_t __pyx_t_20;
18040 Py_ssize_t __pyx_t_21;
18041 Py_ssize_t __pyx_t_22;
18042 Py_ssize_t __pyx_t_23;
18043 Py_ssize_t __pyx_t_24;
18044 Py_ssize_t __pyx_t_25;
18045 Py_ssize_t __pyx_t_26;
18046 Py_ssize_t __pyx_t_27;
18047 Py_ssize_t __pyx_t_28;
18048 Py_ssize_t __pyx_t_29;
18049 Py_ssize_t __pyx_t_30;
18050 Py_ssize_t __pyx_t_31;
18051 PyObject *__pyx_t_32 = NULL;
18052 PyObject *__pyx_t_33 = NULL;
18053 PyObject *__pyx_t_34 = NULL;
18054 PyObject *__pyx_t_35 = NULL;
18057 Py_ssize_t __pyx_t_38;
18058 Py_ssize_t __pyx_t_39;
18059 Py_ssize_t __pyx_t_40;
18060 Py_ssize_t __pyx_t_41;
18061 Py_ssize_t __pyx_t_42;
18062 Py_ssize_t __pyx_t_43;
18063 Py_ssize_t __pyx_t_44;
18064 Py_ssize_t __pyx_t_45;
18065 Py_ssize_t __pyx_t_46;
18066 Py_ssize_t __pyx_t_47;
18067 Py_ssize_t __pyx_t_48;
18068 Py_ssize_t __pyx_t_49;
18069 Py_ssize_t __pyx_t_50;
18070 Py_ssize_t __pyx_t_51;
18071 Py_ssize_t __pyx_t_52;
18072 Py_ssize_t __pyx_t_53;
18073 Py_ssize_t __pyx_t_54;
18074 Py_ssize_t __pyx_t_55;
18075 Py_ssize_t __pyx_t_56;
18076 Py_ssize_t __pyx_t_57;
18077 Py_ssize_t __pyx_t_58;
18078 Py_ssize_t __pyx_t_59;
18079 Py_ssize_t __pyx_t_60;
18080 Py_ssize_t __pyx_t_61;
18081 Py_ssize_t __pyx_t_62;
18082 Py_ssize_t __pyx_t_63;
18083 Py_ssize_t __pyx_t_64;
18084 Py_ssize_t __pyx_t_65;
18085 Py_ssize_t __pyx_t_66;
18086 Py_ssize_t __pyx_t_67;
18087 Py_ssize_t __pyx_t_68;
18088 Py_ssize_t __pyx_t_69;
18089 Py_ssize_t __pyx_t_70;
18090 Py_ssize_t __pyx_t_71;
18091 Py_ssize_t __pyx_t_72;
18092 Py_ssize_t __pyx_t_73;
18093 Py_ssize_t __pyx_t_74;
18094 Py_ssize_t __pyx_t_75;
18095 Py_ssize_t __pyx_t_76;
18096 Py_ssize_t __pyx_t_77;
18097 Py_ssize_t __pyx_t_78;
18098 Py_ssize_t __pyx_t_79;
18099 Py_ssize_t __pyx_t_80;
18100 Py_ssize_t __pyx_t_81;
18101 Py_ssize_t __pyx_t_82;
18102 Py_ssize_t __pyx_t_83;
18103 Py_ssize_t __pyx_t_84;
18104 Py_ssize_t __pyx_t_85;
18105 Py_ssize_t __pyx_t_86;
18106 Py_ssize_t __pyx_t_87;
18107 Py_ssize_t __pyx_t_88;
18108 Py_ssize_t __pyx_t_89;
18109 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval4", 0);
18110 __pyx_pybuffer_x.pybuffer.buf = NULL;
18111 __pyx_pybuffer_x.refcount = 0;
18112 __pyx_pybuffernd_x.data = NULL;
18113 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
18114 __pyx_pybuffer_v.pybuffer.buf = NULL;
18115 __pyx_pybuffer_v.refcount = 0;
18116 __pyx_pybuffernd_v.data = NULL;
18117 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
18119 __Pyx_BufFmt_StackElem __pyx_stack[1];
18120 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 816, __pyx_L1_error)
18122 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
18124 __Pyx_BufFmt_StackElem __pyx_stack[1];
18125 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 816, __pyx_L1_error)
18127 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
18145 __pyx_t_1 = (((__pyx_v_v->dimensions[(__pyx_v_v->nd - 1)]) == 3) != 0);
18155 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
18165 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18166 __pyx_t_3 = __pyx_t_2;
18167 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18168 __pyx_v_eN = __pyx_t_4;
18177 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18178 __pyx_t_6 = __pyx_t_5;
18179 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18180 __pyx_v_ebN = __pyx_t_7;
18189 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18190 __pyx_t_9 = __pyx_t_8;
18191 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18192 __pyx_v_k = __pyx_t_10;
18201 __pyx_t_11 = __pyx_v_eN;
18202 __pyx_t_12 = __pyx_v_ebN;
18203 __pyx_t_13 = __pyx_v_k;
18206 if (__pyx_t_11 < 0) {
18207 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
18208 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
18209 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18210 if (__pyx_t_12 < 0) {
18211 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
18212 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
18213 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18214 if (__pyx_t_13 < 0) {
18215 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
18216 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
18217 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18218 if (__pyx_t_14 < 0) {
18219 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
18220 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
18221 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18222 if (unlikely(__pyx_t_15 != -1)) {
18223 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18224 __PYX_ERR(0, 832, __pyx_L1_error)
18226 __pyx_t_16 = __pyx_v_eN;
18227 __pyx_t_17 = __pyx_v_ebN;
18228 __pyx_t_18 = __pyx_v_k;
18231 if (__pyx_t_16 < 0) {
18232 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
18233 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
18234 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18235 if (__pyx_t_17 < 0) {
18236 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
18237 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
18238 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18239 if (__pyx_t_18 < 0) {
18240 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
18241 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
18242 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18243 if (__pyx_t_19 < 0) {
18244 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
18245 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
18246 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18247 if (unlikely(__pyx_t_15 != -1)) {
18248 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18249 __PYX_ERR(0, 832, __pyx_L1_error)
18251 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18260 __pyx_t_20 = __pyx_v_eN;
18261 __pyx_t_21 = __pyx_v_ebN;
18262 __pyx_t_22 = __pyx_v_k;
18265 if (__pyx_t_20 < 0) {
18266 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[0].shape;
18267 if (unlikely(__pyx_t_20 < 0)) __pyx_t_15 = 0;
18268 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18269 if (__pyx_t_21 < 0) {
18270 __pyx_t_21 += __pyx_pybuffernd_x.diminfo[1].shape;
18271 if (unlikely(__pyx_t_21 < 0)) __pyx_t_15 = 1;
18272 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18273 if (__pyx_t_22 < 0) {
18274 __pyx_t_22 += __pyx_pybuffernd_x.diminfo[2].shape;
18275 if (unlikely(__pyx_t_22 < 0)) __pyx_t_15 = 2;
18276 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18277 if (__pyx_t_23 < 0) {
18278 __pyx_t_23 += __pyx_pybuffernd_x.diminfo[3].shape;
18279 if (unlikely(__pyx_t_23 < 0)) __pyx_t_15 = 3;
18280 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18281 if (unlikely(__pyx_t_15 != -1)) {
18282 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18283 __PYX_ERR(0, 833, __pyx_L1_error)
18285 __pyx_t_24 = __pyx_v_eN;
18286 __pyx_t_25 = __pyx_v_ebN;
18287 __pyx_t_26 = __pyx_v_k;
18290 if (__pyx_t_24 < 0) {
18291 __pyx_t_24 += __pyx_pybuffernd_v.diminfo[0].shape;
18292 if (unlikely(__pyx_t_24 < 0)) __pyx_t_15 = 0;
18293 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18294 if (__pyx_t_25 < 0) {
18295 __pyx_t_25 += __pyx_pybuffernd_v.diminfo[1].shape;
18296 if (unlikely(__pyx_t_25 < 0)) __pyx_t_15 = 1;
18297 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18298 if (__pyx_t_26 < 0) {
18299 __pyx_t_26 += __pyx_pybuffernd_v.diminfo[2].shape;
18300 if (unlikely(__pyx_t_26 < 0)) __pyx_t_15 = 2;
18301 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18302 if (__pyx_t_27 < 0) {
18303 __pyx_t_27 += __pyx_pybuffernd_v.diminfo[3].shape;
18304 if (unlikely(__pyx_t_27 < 0)) __pyx_t_15 = 3;
18305 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18306 if (unlikely(__pyx_t_15 != -1)) {
18307 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18308 __PYX_ERR(0, 833, __pyx_L1_error)
18310 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_26, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_27, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_23, __pyx_pybuffernd_x.diminfo[3].strides))));
18319 __pyx_t_28 = __pyx_v_eN;
18320 __pyx_t_29 = __pyx_v_ebN;
18321 __pyx_t_30 = __pyx_v_k;
18324 if (__pyx_t_28 < 0) {
18325 __pyx_t_28 += __pyx_pybuffernd_v.diminfo[0].shape;
18326 if (unlikely(__pyx_t_28 < 0)) __pyx_t_15 = 0;
18327 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18328 if (__pyx_t_29 < 0) {
18329 __pyx_t_29 += __pyx_pybuffernd_v.diminfo[1].shape;
18330 if (unlikely(__pyx_t_29 < 0)) __pyx_t_15 = 1;
18331 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18332 if (__pyx_t_30 < 0) {
18333 __pyx_t_30 += __pyx_pybuffernd_v.diminfo[2].shape;
18334 if (unlikely(__pyx_t_30 < 0)) __pyx_t_15 = 2;
18335 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18336 if (__pyx_t_31 < 0) {
18337 __pyx_t_31 += __pyx_pybuffernd_v.diminfo[3].shape;
18338 if (unlikely(__pyx_t_31 < 0)) __pyx_t_15 = 3;
18339 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18340 if (unlikely(__pyx_t_15 != -1)) {
18341 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18342 __PYX_ERR(0, 834, __pyx_L1_error)
18344 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_31, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zvelocity;
18353 __pyx_t_32 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 835, __pyx_L1_error)
18354 __Pyx_GOTREF(__pyx_t_32);
18355 __pyx_t_33 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 835, __pyx_L1_error)
18356 __Pyx_GOTREF(__pyx_t_33);
18357 __pyx_t_34 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 835, __pyx_L1_error)
18358 __Pyx_GOTREF(__pyx_t_34);
18359 __pyx_t_35 = PyTuple_New(4);
if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 835, __pyx_L1_error)
18360 __Pyx_GOTREF(__pyx_t_35);
18361 __Pyx_GIVEREF(__pyx_t_32);
18362 PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_32);
18363 __Pyx_GIVEREF(__pyx_t_33);
18364 PyTuple_SET_ITEM(__pyx_t_35, 1, __pyx_t_33);
18365 __Pyx_GIVEREF(__pyx_t_34);
18366 PyTuple_SET_ITEM(__pyx_t_35, 2, __pyx_t_34);
18367 __Pyx_INCREF(__pyx_slice_);
18368 __Pyx_GIVEREF(__pyx_slice_);
18369 PyTuple_SET_ITEM(__pyx_t_35, 3, __pyx_slice_);
18373 __pyx_t_34 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_35);
if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 835, __pyx_L1_error)
18374 __Pyx_GOTREF(__pyx_t_34);
18375 __pyx_t_36 = (__pyx_v_tForReversal - __pyx_v_t);
18376 __pyx_t_37 = (__pyx_v_tForReversal - 0.0);
18377 if (unlikely(__pyx_t_37 == 0)) {
18378 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
18379 __PYX_ERR(0, 835, __pyx_L1_error)
18381 __pyx_t_33 = PyFloat_FromDouble(((__pyx_t_36 / __pyx_t_37) * __pyx_v_clock));
if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 835, __pyx_L1_error)
18382 __Pyx_GOTREF(__pyx_t_33);
18383 __pyx_t_32 = PyNumber_InPlaceMultiply(__pyx_t_34, __pyx_t_33);
if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 835, __pyx_L1_error)
18384 __Pyx_GOTREF(__pyx_t_32);
18385 __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
18386 __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
18387 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_35, __pyx_t_32) < 0)) __PYX_ERR(0, 835, __pyx_L1_error)
18388 __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
18389 __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
18412 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18413 __pyx_t_3 = __pyx_t_2;
18414 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18415 __pyx_v_eN = __pyx_t_4;
18424 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18425 __pyx_t_6 = __pyx_t_5;
18426 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18427 __pyx_v_ebN = __pyx_t_7;
18436 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18437 __pyx_t_9 = __pyx_t_8;
18438 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18439 __pyx_v_k = __pyx_t_10;
18448 __pyx_t_38 = __pyx_v_eN;
18449 __pyx_t_39 = __pyx_v_ebN;
18450 __pyx_t_40 = __pyx_v_k;
18453 if (__pyx_t_38 < 0) {
18454 __pyx_t_38 += __pyx_pybuffernd_x.diminfo[0].shape;
18455 if (unlikely(__pyx_t_38 < 0)) __pyx_t_15 = 0;
18456 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18457 if (__pyx_t_39 < 0) {
18458 __pyx_t_39 += __pyx_pybuffernd_x.diminfo[1].shape;
18459 if (unlikely(__pyx_t_39 < 0)) __pyx_t_15 = 1;
18460 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18461 if (__pyx_t_40 < 0) {
18462 __pyx_t_40 += __pyx_pybuffernd_x.diminfo[2].shape;
18463 if (unlikely(__pyx_t_40 < 0)) __pyx_t_15 = 2;
18464 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18465 if (__pyx_t_41 < 0) {
18466 __pyx_t_41 += __pyx_pybuffernd_x.diminfo[3].shape;
18467 if (unlikely(__pyx_t_41 < 0)) __pyx_t_15 = 3;
18468 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18469 if (unlikely(__pyx_t_15 != -1)) {
18470 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18471 __PYX_ERR(0, 840, __pyx_L1_error)
18473 __pyx_t_42 = __pyx_v_eN;
18474 __pyx_t_43 = __pyx_v_ebN;
18475 __pyx_t_44 = __pyx_v_k;
18478 if (__pyx_t_42 < 0) {
18479 __pyx_t_42 += __pyx_pybuffernd_v.diminfo[0].shape;
18480 if (unlikely(__pyx_t_42 < 0)) __pyx_t_15 = 0;
18481 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18482 if (__pyx_t_43 < 0) {
18483 __pyx_t_43 += __pyx_pybuffernd_v.diminfo[1].shape;
18484 if (unlikely(__pyx_t_43 < 0)) __pyx_t_15 = 1;
18485 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18486 if (__pyx_t_44 < 0) {
18487 __pyx_t_44 += __pyx_pybuffernd_v.diminfo[2].shape;
18488 if (unlikely(__pyx_t_44 < 0)) __pyx_t_15 = 2;
18489 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18490 if (__pyx_t_45 < 0) {
18491 __pyx_t_45 += __pyx_pybuffernd_v.diminfo[3].shape;
18492 if (unlikely(__pyx_t_45 < 0)) __pyx_t_15 = 3;
18493 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18494 if (unlikely(__pyx_t_15 != -1)) {
18495 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18496 __PYX_ERR(0, 840, __pyx_L1_error)
18498 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_44, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_45, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_40, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_41, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18507 __pyx_t_46 = __pyx_v_eN;
18508 __pyx_t_47 = __pyx_v_ebN;
18509 __pyx_t_48 = __pyx_v_k;
18512 if (__pyx_t_46 < 0) {
18513 __pyx_t_46 += __pyx_pybuffernd_x.diminfo[0].shape;
18514 if (unlikely(__pyx_t_46 < 0)) __pyx_t_15 = 0;
18515 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18516 if (__pyx_t_47 < 0) {
18517 __pyx_t_47 += __pyx_pybuffernd_x.diminfo[1].shape;
18518 if (unlikely(__pyx_t_47 < 0)) __pyx_t_15 = 1;
18519 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18520 if (__pyx_t_48 < 0) {
18521 __pyx_t_48 += __pyx_pybuffernd_x.diminfo[2].shape;
18522 if (unlikely(__pyx_t_48 < 0)) __pyx_t_15 = 2;
18523 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18524 if (__pyx_t_49 < 0) {
18525 __pyx_t_49 += __pyx_pybuffernd_x.diminfo[3].shape;
18526 if (unlikely(__pyx_t_49 < 0)) __pyx_t_15 = 3;
18527 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18528 if (unlikely(__pyx_t_15 != -1)) {
18529 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18530 __PYX_ERR(0, 841, __pyx_L1_error)
18532 __pyx_t_50 = __pyx_v_eN;
18533 __pyx_t_51 = __pyx_v_ebN;
18534 __pyx_t_52 = __pyx_v_k;
18537 if (__pyx_t_50 < 0) {
18538 __pyx_t_50 += __pyx_pybuffernd_v.diminfo[0].shape;
18539 if (unlikely(__pyx_t_50 < 0)) __pyx_t_15 = 0;
18540 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18541 if (__pyx_t_51 < 0) {
18542 __pyx_t_51 += __pyx_pybuffernd_v.diminfo[1].shape;
18543 if (unlikely(__pyx_t_51 < 0)) __pyx_t_15 = 1;
18544 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18545 if (__pyx_t_52 < 0) {
18546 __pyx_t_52 += __pyx_pybuffernd_v.diminfo[2].shape;
18547 if (unlikely(__pyx_t_52 < 0)) __pyx_t_15 = 2;
18548 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18549 if (__pyx_t_53 < 0) {
18550 __pyx_t_53 += __pyx_pybuffernd_v.diminfo[3].shape;
18551 if (unlikely(__pyx_t_53 < 0)) __pyx_t_15 = 3;
18552 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18553 if (unlikely(__pyx_t_15 != -1)) {
18554 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18555 __PYX_ERR(0, 841, __pyx_L1_error)
18557 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_52, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_53, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_48, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_49, __pyx_pybuffernd_x.diminfo[3].strides))));
18566 __pyx_t_54 = __pyx_v_eN;
18567 __pyx_t_55 = __pyx_v_ebN;
18568 __pyx_t_56 = __pyx_v_k;
18571 if (__pyx_t_54 < 0) {
18572 __pyx_t_54 += __pyx_pybuffernd_v.diminfo[0].shape;
18573 if (unlikely(__pyx_t_54 < 0)) __pyx_t_15 = 0;
18574 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18575 if (__pyx_t_55 < 0) {
18576 __pyx_t_55 += __pyx_pybuffernd_v.diminfo[1].shape;
18577 if (unlikely(__pyx_t_55 < 0)) __pyx_t_15 = 1;
18578 }
else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18579 if (__pyx_t_56 < 0) {
18580 __pyx_t_56 += __pyx_pybuffernd_v.diminfo[2].shape;
18581 if (unlikely(__pyx_t_56 < 0)) __pyx_t_15 = 2;
18582 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18583 if (__pyx_t_57 < 0) {
18584 __pyx_t_57 += __pyx_pybuffernd_v.diminfo[3].shape;
18585 if (unlikely(__pyx_t_57 < 0)) __pyx_t_15 = 3;
18586 }
else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18587 if (unlikely(__pyx_t_15 != -1)) {
18588 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18589 __PYX_ERR(0, 842, __pyx_L1_error)
18591 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_55, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_56, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_57, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zvelocity;
18616 #ifndef CYTHON_WITHOUT_ASSERTIONS 18617 if (unlikely(!Py_OptimizeFlag)) {
18618 if (unlikely(!(((__pyx_v_v->dimensions[(__pyx_v_v->nd - 1)]) == 2) != 0))) {
18619 PyErr_SetNone(PyExc_AssertionError);
18620 __PYX_ERR(0, 844, __pyx_L1_error)
18632 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
18642 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18643 __pyx_t_3 = __pyx_t_2;
18644 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18645 __pyx_v_eN = __pyx_t_4;
18654 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18655 __pyx_t_6 = __pyx_t_5;
18656 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18657 __pyx_v_ebN = __pyx_t_7;
18666 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18667 __pyx_t_9 = __pyx_t_8;
18668 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18669 __pyx_v_k = __pyx_t_10;
18678 __pyx_t_58 = __pyx_v_eN;
18679 __pyx_t_59 = __pyx_v_ebN;
18680 __pyx_t_60 = __pyx_v_k;
18683 if (__pyx_t_58 < 0) {
18684 __pyx_t_58 += __pyx_pybuffernd_x.diminfo[0].shape;
18685 if (unlikely(__pyx_t_58 < 0)) __pyx_t_15 = 0;
18686 }
else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18687 if (__pyx_t_59 < 0) {
18688 __pyx_t_59 += __pyx_pybuffernd_x.diminfo[1].shape;
18689 if (unlikely(__pyx_t_59 < 0)) __pyx_t_15 = 1;
18690 }
else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18691 if (__pyx_t_60 < 0) {
18692 __pyx_t_60 += __pyx_pybuffernd_x.diminfo[2].shape;
18693 if (unlikely(__pyx_t_60 < 0)) __pyx_t_15 = 2;
18694 }
else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18695 if (__pyx_t_61 < 0) {
18696 __pyx_t_61 += __pyx_pybuffernd_x.diminfo[3].shape;
18697 if (unlikely(__pyx_t_61 < 0)) __pyx_t_15 = 3;
18698 }
else if (unlikely(__pyx_t_61 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18699 if (unlikely(__pyx_t_15 != -1)) {
18700 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18701 __PYX_ERR(0, 849, __pyx_L1_error)
18703 __pyx_t_62 = __pyx_v_eN;
18704 __pyx_t_63 = __pyx_v_ebN;
18705 __pyx_t_64 = __pyx_v_k;
18708 if (__pyx_t_62 < 0) {
18709 __pyx_t_62 += __pyx_pybuffernd_v.diminfo[0].shape;
18710 if (unlikely(__pyx_t_62 < 0)) __pyx_t_15 = 0;
18711 }
else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18712 if (__pyx_t_63 < 0) {
18713 __pyx_t_63 += __pyx_pybuffernd_v.diminfo[1].shape;
18714 if (unlikely(__pyx_t_63 < 0)) __pyx_t_15 = 1;
18715 }
else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18716 if (__pyx_t_64 < 0) {
18717 __pyx_t_64 += __pyx_pybuffernd_v.diminfo[2].shape;
18718 if (unlikely(__pyx_t_64 < 0)) __pyx_t_15 = 2;
18719 }
else if (unlikely(__pyx_t_64 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18720 if (__pyx_t_65 < 0) {
18721 __pyx_t_65 += __pyx_pybuffernd_v.diminfo[3].shape;
18722 if (unlikely(__pyx_t_65 < 0)) __pyx_t_15 = 3;
18723 }
else if (unlikely(__pyx_t_65 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18724 if (unlikely(__pyx_t_15 != -1)) {
18725 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18726 __PYX_ERR(0, 849, __pyx_L1_error)
18728 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_62, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_63, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_64, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_65, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_59, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_60, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_61, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18737 __pyx_t_66 = __pyx_v_eN;
18738 __pyx_t_67 = __pyx_v_ebN;
18739 __pyx_t_68 = __pyx_v_k;
18742 if (__pyx_t_66 < 0) {
18743 __pyx_t_66 += __pyx_pybuffernd_x.diminfo[0].shape;
18744 if (unlikely(__pyx_t_66 < 0)) __pyx_t_15 = 0;
18745 }
else if (unlikely(__pyx_t_66 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18746 if (__pyx_t_67 < 0) {
18747 __pyx_t_67 += __pyx_pybuffernd_x.diminfo[1].shape;
18748 if (unlikely(__pyx_t_67 < 0)) __pyx_t_15 = 1;
18749 }
else if (unlikely(__pyx_t_67 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18750 if (__pyx_t_68 < 0) {
18751 __pyx_t_68 += __pyx_pybuffernd_x.diminfo[2].shape;
18752 if (unlikely(__pyx_t_68 < 0)) __pyx_t_15 = 2;
18753 }
else if (unlikely(__pyx_t_68 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18754 if (__pyx_t_69 < 0) {
18755 __pyx_t_69 += __pyx_pybuffernd_x.diminfo[3].shape;
18756 if (unlikely(__pyx_t_69 < 0)) __pyx_t_15 = 3;
18757 }
else if (unlikely(__pyx_t_69 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18758 if (unlikely(__pyx_t_15 != -1)) {
18759 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18760 __PYX_ERR(0, 850, __pyx_L1_error)
18762 __pyx_t_70 = __pyx_v_eN;
18763 __pyx_t_71 = __pyx_v_ebN;
18764 __pyx_t_72 = __pyx_v_k;
18767 if (__pyx_t_70 < 0) {
18768 __pyx_t_70 += __pyx_pybuffernd_v.diminfo[0].shape;
18769 if (unlikely(__pyx_t_70 < 0)) __pyx_t_15 = 0;
18770 }
else if (unlikely(__pyx_t_70 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18771 if (__pyx_t_71 < 0) {
18772 __pyx_t_71 += __pyx_pybuffernd_v.diminfo[1].shape;
18773 if (unlikely(__pyx_t_71 < 0)) __pyx_t_15 = 1;
18774 }
else if (unlikely(__pyx_t_71 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18775 if (__pyx_t_72 < 0) {
18776 __pyx_t_72 += __pyx_pybuffernd_v.diminfo[2].shape;
18777 if (unlikely(__pyx_t_72 < 0)) __pyx_t_15 = 2;
18778 }
else if (unlikely(__pyx_t_72 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18779 if (__pyx_t_73 < 0) {
18780 __pyx_t_73 += __pyx_pybuffernd_v.diminfo[3].shape;
18781 if (unlikely(__pyx_t_73 < 0)) __pyx_t_15 = 3;
18782 }
else if (unlikely(__pyx_t_73 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18783 if (unlikely(__pyx_t_15 != -1)) {
18784 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18785 __PYX_ERR(0, 850, __pyx_L1_error)
18787 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_70, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_71, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_72, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_73, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_66, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_67, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_68, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_69, __pyx_pybuffernd_x.diminfo[3].strides))));
18796 __pyx_t_35 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 851, __pyx_L1_error)
18797 __Pyx_GOTREF(__pyx_t_35);
18798 __pyx_t_32 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 851, __pyx_L1_error)
18799 __Pyx_GOTREF(__pyx_t_32);
18800 __pyx_t_33 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 851, __pyx_L1_error)
18801 __Pyx_GOTREF(__pyx_t_33);
18802 __pyx_t_34 = PyTuple_New(4);
if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 851, __pyx_L1_error)
18803 __Pyx_GOTREF(__pyx_t_34);
18804 __Pyx_GIVEREF(__pyx_t_35);
18805 PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_t_35);
18806 __Pyx_GIVEREF(__pyx_t_32);
18807 PyTuple_SET_ITEM(__pyx_t_34, 1, __pyx_t_32);
18808 __Pyx_GIVEREF(__pyx_t_33);
18809 PyTuple_SET_ITEM(__pyx_t_34, 2, __pyx_t_33);
18810 __Pyx_INCREF(__pyx_slice_);
18811 __Pyx_GIVEREF(__pyx_slice_);
18812 PyTuple_SET_ITEM(__pyx_t_34, 3, __pyx_slice_);
18816 __pyx_t_33 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_34);
if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 851, __pyx_L1_error)
18817 __Pyx_GOTREF(__pyx_t_33);
18818 __pyx_t_37 = (__pyx_v_tForReversal - __pyx_v_t);
18819 __pyx_t_36 = (__pyx_v_tForReversal - 0.0);
18820 if (unlikely(__pyx_t_36 == 0)) {
18821 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
18822 __PYX_ERR(0, 851, __pyx_L1_error)
18824 __pyx_t_32 = PyFloat_FromDouble(((__pyx_t_37 / __pyx_t_36) * __pyx_v_clock));
if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 851, __pyx_L1_error)
18825 __Pyx_GOTREF(__pyx_t_32);
18826 __pyx_t_35 = PyNumber_InPlaceMultiply(__pyx_t_33, __pyx_t_32);
if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 851, __pyx_L1_error)
18827 __Pyx_GOTREF(__pyx_t_35);
18828 __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
18829 __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
18830 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_34, __pyx_t_35) < 0)) __PYX_ERR(0, 851, __pyx_L1_error)
18831 __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
18832 __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
18855 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18856 __pyx_t_3 = __pyx_t_2;
18857 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18858 __pyx_v_eN = __pyx_t_4;
18867 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18868 __pyx_t_6 = __pyx_t_5;
18869 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18870 __pyx_v_ebN = __pyx_t_7;
18879 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18880 __pyx_t_9 = __pyx_t_8;
18881 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18882 __pyx_v_k = __pyx_t_10;
18891 __pyx_t_74 = __pyx_v_eN;
18892 __pyx_t_75 = __pyx_v_ebN;
18893 __pyx_t_76 = __pyx_v_k;
18896 if (__pyx_t_74 < 0) {
18897 __pyx_t_74 += __pyx_pybuffernd_x.diminfo[0].shape;
18898 if (unlikely(__pyx_t_74 < 0)) __pyx_t_15 = 0;
18899 }
else if (unlikely(__pyx_t_74 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18900 if (__pyx_t_75 < 0) {
18901 __pyx_t_75 += __pyx_pybuffernd_x.diminfo[1].shape;
18902 if (unlikely(__pyx_t_75 < 0)) __pyx_t_15 = 1;
18903 }
else if (unlikely(__pyx_t_75 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18904 if (__pyx_t_76 < 0) {
18905 __pyx_t_76 += __pyx_pybuffernd_x.diminfo[2].shape;
18906 if (unlikely(__pyx_t_76 < 0)) __pyx_t_15 = 2;
18907 }
else if (unlikely(__pyx_t_76 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18908 if (__pyx_t_77 < 0) {
18909 __pyx_t_77 += __pyx_pybuffernd_x.diminfo[3].shape;
18910 if (unlikely(__pyx_t_77 < 0)) __pyx_t_15 = 3;
18911 }
else if (unlikely(__pyx_t_77 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18912 if (unlikely(__pyx_t_15 != -1)) {
18913 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18914 __PYX_ERR(0, 856, __pyx_L1_error)
18916 __pyx_t_78 = __pyx_v_eN;
18917 __pyx_t_79 = __pyx_v_ebN;
18918 __pyx_t_80 = __pyx_v_k;
18921 if (__pyx_t_78 < 0) {
18922 __pyx_t_78 += __pyx_pybuffernd_v.diminfo[0].shape;
18923 if (unlikely(__pyx_t_78 < 0)) __pyx_t_15 = 0;
18924 }
else if (unlikely(__pyx_t_78 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18925 if (__pyx_t_79 < 0) {
18926 __pyx_t_79 += __pyx_pybuffernd_v.diminfo[1].shape;
18927 if (unlikely(__pyx_t_79 < 0)) __pyx_t_15 = 1;
18928 }
else if (unlikely(__pyx_t_79 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18929 if (__pyx_t_80 < 0) {
18930 __pyx_t_80 += __pyx_pybuffernd_v.diminfo[2].shape;
18931 if (unlikely(__pyx_t_80 < 0)) __pyx_t_15 = 2;
18932 }
else if (unlikely(__pyx_t_80 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18933 if (__pyx_t_81 < 0) {
18934 __pyx_t_81 += __pyx_pybuffernd_v.diminfo[3].shape;
18935 if (unlikely(__pyx_t_81 < 0)) __pyx_t_15 = 3;
18936 }
else if (unlikely(__pyx_t_81 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18937 if (unlikely(__pyx_t_15 != -1)) {
18938 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18939 __PYX_ERR(0, 856, __pyx_L1_error)
18941 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_78, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_79, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_80, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_81, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_74, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_75, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_76, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_77, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18950 __pyx_t_82 = __pyx_v_eN;
18951 __pyx_t_83 = __pyx_v_ebN;
18952 __pyx_t_84 = __pyx_v_k;
18955 if (__pyx_t_82 < 0) {
18956 __pyx_t_82 += __pyx_pybuffernd_x.diminfo[0].shape;
18957 if (unlikely(__pyx_t_82 < 0)) __pyx_t_15 = 0;
18958 }
else if (unlikely(__pyx_t_82 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18959 if (__pyx_t_83 < 0) {
18960 __pyx_t_83 += __pyx_pybuffernd_x.diminfo[1].shape;
18961 if (unlikely(__pyx_t_83 < 0)) __pyx_t_15 = 1;
18962 }
else if (unlikely(__pyx_t_83 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18963 if (__pyx_t_84 < 0) {
18964 __pyx_t_84 += __pyx_pybuffernd_x.diminfo[2].shape;
18965 if (unlikely(__pyx_t_84 < 0)) __pyx_t_15 = 2;
18966 }
else if (unlikely(__pyx_t_84 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18967 if (__pyx_t_85 < 0) {
18968 __pyx_t_85 += __pyx_pybuffernd_x.diminfo[3].shape;
18969 if (unlikely(__pyx_t_85 < 0)) __pyx_t_15 = 3;
18970 }
else if (unlikely(__pyx_t_85 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18971 if (unlikely(__pyx_t_15 != -1)) {
18972 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18973 __PYX_ERR(0, 857, __pyx_L1_error)
18975 __pyx_t_86 = __pyx_v_eN;
18976 __pyx_t_87 = __pyx_v_ebN;
18977 __pyx_t_88 = __pyx_v_k;
18980 if (__pyx_t_86 < 0) {
18981 __pyx_t_86 += __pyx_pybuffernd_v.diminfo[0].shape;
18982 if (unlikely(__pyx_t_86 < 0)) __pyx_t_15 = 0;
18983 }
else if (unlikely(__pyx_t_86 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18984 if (__pyx_t_87 < 0) {
18985 __pyx_t_87 += __pyx_pybuffernd_v.diminfo[1].shape;
18986 if (unlikely(__pyx_t_87 < 0)) __pyx_t_15 = 1;
18987 }
else if (unlikely(__pyx_t_87 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18988 if (__pyx_t_88 < 0) {
18989 __pyx_t_88 += __pyx_pybuffernd_v.diminfo[2].shape;
18990 if (unlikely(__pyx_t_88 < 0)) __pyx_t_15 = 2;
18991 }
else if (unlikely(__pyx_t_88 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18992 if (__pyx_t_89 < 0) {
18993 __pyx_t_89 += __pyx_pybuffernd_v.diminfo[3].shape;
18994 if (unlikely(__pyx_t_89 < 0)) __pyx_t_15 = 3;
18995 }
else if (unlikely(__pyx_t_89 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18996 if (unlikely(__pyx_t_15 != -1)) {
18997 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18998 __PYX_ERR(0, 857, __pyx_L1_error)
19000 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_86, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_87, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_88, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_89, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_82, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_83, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_84, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_85, __pyx_pybuffernd_x.diminfo[3].strides))));
19018 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19021 __Pyx_XDECREF(__pyx_t_32);
19022 __Pyx_XDECREF(__pyx_t_33);
19023 __Pyx_XDECREF(__pyx_t_34);
19024 __Pyx_XDECREF(__pyx_t_35);
19025 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
19026 __Pyx_PyThreadState_declare
19027 __Pyx_PyThreadState_assign
19028 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
19029 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19030 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19031 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
19032 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19036 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19037 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19039 __Pyx_XGIVEREF(__pyx_r);
19040 __Pyx_RefNannyFinishContext();
19053 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
19054 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_51helicalElementVelocityEval3 = {
"helicalElementVelocityEval3", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
19055 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19056 int __pyx_v_transient;
19058 double __pyx_v_tForReversal;
19059 double __pyx_v_clock;
19060 double __pyx_v_zVelocity;
19063 PyArrayObject *__pyx_v_x = 0;
19064 PyArrayObject *__pyx_v_v = 0;
19065 PyObject *__pyx_r = 0;
19066 __Pyx_RefNannyDeclarations
19067 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval3 (wrapper)", 0);
19069 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_zVelocity,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,0};
19070 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
19071 if (unlikely(__pyx_kwds)) {
19072 Py_ssize_t kw_args;
19073 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19074 switch (pos_args) {
19075 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19076 CYTHON_FALLTHROUGH;
19077 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19078 CYTHON_FALLTHROUGH;
19079 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19080 CYTHON_FALLTHROUGH;
19081 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19082 CYTHON_FALLTHROUGH;
19083 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19084 CYTHON_FALLTHROUGH;
19085 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19086 CYTHON_FALLTHROUGH;
19087 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19088 CYTHON_FALLTHROUGH;
19089 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19090 CYTHON_FALLTHROUGH;
19091 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19092 CYTHON_FALLTHROUGH;
19094 default:
goto __pyx_L5_argtuple_error;
19096 kw_args = PyDict_Size(__pyx_kwds);
19097 switch (pos_args) {
19099 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
19100 else goto __pyx_L5_argtuple_error;
19101 CYTHON_FALLTHROUGH;
19103 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
19105 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 1); __PYX_ERR(0, 859, __pyx_L3_error)
19107 CYTHON_FALLTHROUGH;
19109 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
19111 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 2); __PYX_ERR(0, 859, __pyx_L3_error)
19113 CYTHON_FALLTHROUGH;
19115 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
19117 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 3); __PYX_ERR(0, 859, __pyx_L3_error)
19119 CYTHON_FALLTHROUGH;
19121 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zVelocity)) != 0)) kw_args--;
19123 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 4); __PYX_ERR(0, 859, __pyx_L3_error)
19125 CYTHON_FALLTHROUGH;
19127 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
19129 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 5); __PYX_ERR(0, 859, __pyx_L3_error)
19131 CYTHON_FALLTHROUGH;
19133 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
19135 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 6); __PYX_ERR(0, 859, __pyx_L3_error)
19137 CYTHON_FALLTHROUGH;
19139 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
19141 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 7); __PYX_ERR(0, 859, __pyx_L3_error)
19143 CYTHON_FALLTHROUGH;
19145 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
19147 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 8); __PYX_ERR(0, 859, __pyx_L3_error)
19150 if (unlikely(kw_args > 0)) {
19151 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"helicalElementVelocityEval3") < 0)) __PYX_ERR(0, 859, __pyx_L3_error)
19153 }
else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
19154 goto __pyx_L5_argtuple_error;
19156 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19157 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19158 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19159 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19160 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19161 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19162 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19163 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19164 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19166 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 859, __pyx_L3_error)
19167 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 860, __pyx_L3_error)
19168 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 861, __pyx_L3_error)
19169 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 862, __pyx_L3_error)
19170 __pyx_v_zVelocity = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_zVelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 863, __pyx_L3_error)
19171 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L3_error)
19172 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[6]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L3_error)
19173 __pyx_v_x = ((PyArrayObject *)values[7]);
19174 __pyx_v_v = ((PyArrayObject *)values[8]);
19176 goto __pyx_L4_argument_unpacking_done;
19177 __pyx_L5_argtuple_error:;
19178 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 859, __pyx_L3_error)
19180 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19181 __Pyx_RefNannyFinishContext();
19183 __pyx_L4_argument_unpacking_done:;
19184 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 865, __pyx_L1_error)
19185 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 866, __pyx_L1_error)
19186 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_zVelocity, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v);
19193 __Pyx_RefNannyFinishContext();
19197 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
19201 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
19202 __Pyx_Buffer __pyx_pybuffer_v;
19203 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
19204 __Pyx_Buffer __pyx_pybuffer_x;
19205 PyObject *__pyx_r = NULL;
19206 __Pyx_RefNannyDeclarations
19208 npy_intp __pyx_t_2;
19209 npy_intp __pyx_t_3;
19211 npy_intp __pyx_t_5;
19212 npy_intp __pyx_t_6;
19214 Py_ssize_t __pyx_t_8;
19215 Py_ssize_t __pyx_t_9;
19216 Py_ssize_t __pyx_t_10;
19218 Py_ssize_t __pyx_t_12;
19219 Py_ssize_t __pyx_t_13;
19220 Py_ssize_t __pyx_t_14;
19221 Py_ssize_t __pyx_t_15;
19222 Py_ssize_t __pyx_t_16;
19223 Py_ssize_t __pyx_t_17;
19224 Py_ssize_t __pyx_t_18;
19225 Py_ssize_t __pyx_t_19;
19226 Py_ssize_t __pyx_t_20;
19227 Py_ssize_t __pyx_t_21;
19228 Py_ssize_t __pyx_t_22;
19229 Py_ssize_t __pyx_t_23;
19230 PyObject *__pyx_t_24 = NULL;
19231 PyObject *__pyx_t_25 = NULL;
19232 PyObject *__pyx_t_26 = NULL;
19235 PyObject *__pyx_t_29 = NULL;
19236 Py_ssize_t __pyx_t_30;
19237 Py_ssize_t __pyx_t_31;
19238 Py_ssize_t __pyx_t_32;
19239 Py_ssize_t __pyx_t_33;
19240 Py_ssize_t __pyx_t_34;
19241 Py_ssize_t __pyx_t_35;
19242 Py_ssize_t __pyx_t_36;
19243 Py_ssize_t __pyx_t_37;
19244 Py_ssize_t __pyx_t_38;
19245 Py_ssize_t __pyx_t_39;
19246 Py_ssize_t __pyx_t_40;
19247 Py_ssize_t __pyx_t_41;
19248 Py_ssize_t __pyx_t_42;
19249 Py_ssize_t __pyx_t_43;
19250 Py_ssize_t __pyx_t_44;
19251 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval3", 0);
19252 __pyx_pybuffer_x.pybuffer.buf = NULL;
19253 __pyx_pybuffer_x.refcount = 0;
19254 __pyx_pybuffernd_x.data = NULL;
19255 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
19256 __pyx_pybuffer_v.pybuffer.buf = NULL;
19257 __pyx_pybuffer_v.refcount = 0;
19258 __pyx_pybuffernd_v.data = NULL;
19259 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
19261 __Pyx_BufFmt_StackElem __pyx_stack[1];
19262 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 859, __pyx_L1_error)
19264 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
19266 __Pyx_BufFmt_StackElem __pyx_stack[1];
19267 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 859, __pyx_L1_error)
19269 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
19287 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
19297 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
19298 __pyx_t_3 = __pyx_t_2;
19299 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19300 __pyx_v_eN = __pyx_t_4;
19309 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
19310 __pyx_t_6 = __pyx_t_5;
19311 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
19312 __pyx_v_k = __pyx_t_7;
19321 __pyx_t_8 = __pyx_v_eN;
19322 __pyx_t_9 = __pyx_v_k;
19325 if (__pyx_t_8 < 0) {
19326 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
19327 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
19328 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19329 if (__pyx_t_9 < 0) {
19330 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
19331 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19332 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19333 if (__pyx_t_10 < 0) {
19334 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
19335 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
19336 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19337 if (unlikely(__pyx_t_11 != -1)) {
19338 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19339 __PYX_ERR(0, 873, __pyx_L1_error)
19341 __pyx_t_12 = __pyx_v_eN;
19342 __pyx_t_13 = __pyx_v_k;
19345 if (__pyx_t_12 < 0) {
19346 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
19347 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
19348 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19349 if (__pyx_t_13 < 0) {
19350 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
19351 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
19352 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19353 if (__pyx_t_14 < 0) {
19354 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
19355 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
19356 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19357 if (unlikely(__pyx_t_11 != -1)) {
19358 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19359 __PYX_ERR(0, 873, __pyx_L1_error)
19361 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
19370 __pyx_t_15 = __pyx_v_eN;
19371 __pyx_t_16 = __pyx_v_k;
19374 if (__pyx_t_15 < 0) {
19375 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[0].shape;
19376 if (unlikely(__pyx_t_15 < 0)) __pyx_t_11 = 0;
19377 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19378 if (__pyx_t_16 < 0) {
19379 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[1].shape;
19380 if (unlikely(__pyx_t_16 < 0)) __pyx_t_11 = 1;
19381 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19382 if (__pyx_t_17 < 0) {
19383 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[2].shape;
19384 if (unlikely(__pyx_t_17 < 0)) __pyx_t_11 = 2;
19385 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19386 if (unlikely(__pyx_t_11 != -1)) {
19387 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19388 __PYX_ERR(0, 874, __pyx_L1_error)
19390 __pyx_t_18 = __pyx_v_eN;
19391 __pyx_t_19 = __pyx_v_k;
19394 if (__pyx_t_18 < 0) {
19395 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[0].shape;
19396 if (unlikely(__pyx_t_18 < 0)) __pyx_t_11 = 0;
19397 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19398 if (__pyx_t_19 < 0) {
19399 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[1].shape;
19400 if (unlikely(__pyx_t_19 < 0)) __pyx_t_11 = 1;
19401 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19402 if (__pyx_t_20 < 0) {
19403 __pyx_t_20 += __pyx_pybuffernd_v.diminfo[2].shape;
19404 if (unlikely(__pyx_t_20 < 0)) __pyx_t_11 = 2;
19405 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19406 if (unlikely(__pyx_t_11 != -1)) {
19407 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19408 __PYX_ERR(0, 874, __pyx_L1_error)
19410 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_x.diminfo[2].strides))));
19419 __pyx_t_21 = __pyx_v_eN;
19420 __pyx_t_22 = __pyx_v_k;
19423 if (__pyx_t_21 < 0) {
19424 __pyx_t_21 += __pyx_pybuffernd_v.diminfo[0].shape;
19425 if (unlikely(__pyx_t_21 < 0)) __pyx_t_11 = 0;
19426 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19427 if (__pyx_t_22 < 0) {
19428 __pyx_t_22 += __pyx_pybuffernd_v.diminfo[1].shape;
19429 if (unlikely(__pyx_t_22 < 0)) __pyx_t_11 = 1;
19430 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19431 if (__pyx_t_23 < 0) {
19432 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[2].shape;
19433 if (unlikely(__pyx_t_23 < 0)) __pyx_t_11 = 2;
19434 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19435 if (unlikely(__pyx_t_11 != -1)) {
19436 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19437 __PYX_ERR(0, 875, __pyx_L1_error)
19439 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zVelocity;
19448 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 876, __pyx_L1_error)
19449 __Pyx_GOTREF(__pyx_t_24);
19450 __pyx_t_25 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 876, __pyx_L1_error)
19451 __Pyx_GOTREF(__pyx_t_25);
19452 __pyx_t_26 = PyTuple_New(3);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 876, __pyx_L1_error)
19453 __Pyx_GOTREF(__pyx_t_26);
19454 __Pyx_GIVEREF(__pyx_t_24);
19455 PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_24);
19456 __Pyx_GIVEREF(__pyx_t_25);
19457 PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_t_25);
19458 __Pyx_INCREF(__pyx_slice_);
19459 __Pyx_GIVEREF(__pyx_slice_);
19460 PyTuple_SET_ITEM(__pyx_t_26, 2, __pyx_slice_);
19463 __pyx_t_25 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_26);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 876, __pyx_L1_error)
19464 __Pyx_GOTREF(__pyx_t_25);
19465 __pyx_t_27 = (__pyx_v_pi * __pyx_v_t);
19466 __pyx_t_28 = (__pyx_v_tForReversal * 2.0);
19467 if (unlikely(__pyx_t_28 == 0)) {
19468 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
19469 __PYX_ERR(0, 876, __pyx_L1_error)
19471 __pyx_t_24 = PyFloat_FromDouble((__pyx_v_clock * cos((__pyx_t_27 / __pyx_t_28))));
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 876, __pyx_L1_error)
19472 __Pyx_GOTREF(__pyx_t_24);
19473 __pyx_t_29 = PyNumber_InPlaceMultiply(__pyx_t_25, __pyx_t_24);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 876, __pyx_L1_error)
19474 __Pyx_GOTREF(__pyx_t_29);
19475 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
19476 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
19477 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_26, __pyx_t_29) < 0)) __PYX_ERR(0, 876, __pyx_L1_error)
19478 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
19479 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
19501 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
19502 __pyx_t_3 = __pyx_t_2;
19503 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19504 __pyx_v_eN = __pyx_t_4;
19513 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
19514 __pyx_t_6 = __pyx_t_5;
19515 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
19516 __pyx_v_k = __pyx_t_7;
19525 __pyx_t_30 = __pyx_v_eN;
19526 __pyx_t_31 = __pyx_v_k;
19529 if (__pyx_t_30 < 0) {
19530 __pyx_t_30 += __pyx_pybuffernd_x.diminfo[0].shape;
19531 if (unlikely(__pyx_t_30 < 0)) __pyx_t_11 = 0;
19532 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19533 if (__pyx_t_31 < 0) {
19534 __pyx_t_31 += __pyx_pybuffernd_x.diminfo[1].shape;
19535 if (unlikely(__pyx_t_31 < 0)) __pyx_t_11 = 1;
19536 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19537 if (__pyx_t_32 < 0) {
19538 __pyx_t_32 += __pyx_pybuffernd_x.diminfo[2].shape;
19539 if (unlikely(__pyx_t_32 < 0)) __pyx_t_11 = 2;
19540 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19541 if (unlikely(__pyx_t_11 != -1)) {
19542 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19543 __PYX_ERR(0, 880, __pyx_L1_error)
19545 __pyx_t_33 = __pyx_v_eN;
19546 __pyx_t_34 = __pyx_v_k;
19549 if (__pyx_t_33 < 0) {
19550 __pyx_t_33 += __pyx_pybuffernd_v.diminfo[0].shape;
19551 if (unlikely(__pyx_t_33 < 0)) __pyx_t_11 = 0;
19552 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19553 if (__pyx_t_34 < 0) {
19554 __pyx_t_34 += __pyx_pybuffernd_v.diminfo[1].shape;
19555 if (unlikely(__pyx_t_34 < 0)) __pyx_t_11 = 1;
19556 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19557 if (__pyx_t_35 < 0) {
19558 __pyx_t_35 += __pyx_pybuffernd_v.diminfo[2].shape;
19559 if (unlikely(__pyx_t_35 < 0)) __pyx_t_11 = 2;
19560 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19561 if (unlikely(__pyx_t_11 != -1)) {
19562 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19563 __PYX_ERR(0, 880, __pyx_L1_error)
19565 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_35, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_32, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
19574 __pyx_t_36 = __pyx_v_eN;
19575 __pyx_t_37 = __pyx_v_k;
19578 if (__pyx_t_36 < 0) {
19579 __pyx_t_36 += __pyx_pybuffernd_x.diminfo[0].shape;
19580 if (unlikely(__pyx_t_36 < 0)) __pyx_t_11 = 0;
19581 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19582 if (__pyx_t_37 < 0) {
19583 __pyx_t_37 += __pyx_pybuffernd_x.diminfo[1].shape;
19584 if (unlikely(__pyx_t_37 < 0)) __pyx_t_11 = 1;
19585 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19586 if (__pyx_t_38 < 0) {
19587 __pyx_t_38 += __pyx_pybuffernd_x.diminfo[2].shape;
19588 if (unlikely(__pyx_t_38 < 0)) __pyx_t_11 = 2;
19589 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19590 if (unlikely(__pyx_t_11 != -1)) {
19591 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19592 __PYX_ERR(0, 881, __pyx_L1_error)
19594 __pyx_t_39 = __pyx_v_eN;
19595 __pyx_t_40 = __pyx_v_k;
19598 if (__pyx_t_39 < 0) {
19599 __pyx_t_39 += __pyx_pybuffernd_v.diminfo[0].shape;
19600 if (unlikely(__pyx_t_39 < 0)) __pyx_t_11 = 0;
19601 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19602 if (__pyx_t_40 < 0) {
19603 __pyx_t_40 += __pyx_pybuffernd_v.diminfo[1].shape;
19604 if (unlikely(__pyx_t_40 < 0)) __pyx_t_11 = 1;
19605 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19606 if (__pyx_t_41 < 0) {
19607 __pyx_t_41 += __pyx_pybuffernd_v.diminfo[2].shape;
19608 if (unlikely(__pyx_t_41 < 0)) __pyx_t_11 = 2;
19609 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19610 if (unlikely(__pyx_t_11 != -1)) {
19611 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19612 __PYX_ERR(0, 881, __pyx_L1_error)
19614 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_41, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_38, __pyx_pybuffernd_x.diminfo[2].strides))));
19623 __pyx_t_42 = __pyx_v_eN;
19624 __pyx_t_43 = __pyx_v_k;
19627 if (__pyx_t_42 < 0) {
19628 __pyx_t_42 += __pyx_pybuffernd_v.diminfo[0].shape;
19629 if (unlikely(__pyx_t_42 < 0)) __pyx_t_11 = 0;
19630 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19631 if (__pyx_t_43 < 0) {
19632 __pyx_t_43 += __pyx_pybuffernd_v.diminfo[1].shape;
19633 if (unlikely(__pyx_t_43 < 0)) __pyx_t_11 = 1;
19634 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19635 if (__pyx_t_44 < 0) {
19636 __pyx_t_44 += __pyx_pybuffernd_v.diminfo[2].shape;
19637 if (unlikely(__pyx_t_44 < 0)) __pyx_t_11 = 2;
19638 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19639 if (unlikely(__pyx_t_11 != -1)) {
19640 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19641 __PYX_ERR(0, 882, __pyx_L1_error)
19643 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_44, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zVelocity;
19658 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19661 __Pyx_XDECREF(__pyx_t_24);
19662 __Pyx_XDECREF(__pyx_t_25);
19663 __Pyx_XDECREF(__pyx_t_26);
19664 __Pyx_XDECREF(__pyx_t_29);
19665 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
19666 __Pyx_PyThreadState_declare
19667 __Pyx_PyThreadState_assign
19668 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
19669 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19670 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19671 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
19672 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19676 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19677 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19679 __Pyx_XGIVEREF(__pyx_r);
19680 __Pyx_RefNannyFinishContext();
19693 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
19694 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_53helicalElementVelocityEval4 = {
"helicalElementVelocityEval4", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
19695 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19696 int __pyx_v_transient;
19698 double __pyx_v_tForReversal;
19699 double __pyx_v_clock;
19700 double __pyx_v_zVelocity;
19703 PyArrayObject *__pyx_v_x = 0;
19704 PyArrayObject *__pyx_v_v = 0;
19705 PyObject *__pyx_r = 0;
19706 __Pyx_RefNannyDeclarations
19707 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval4 (wrapper)", 0);
19709 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_zVelocity,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,0};
19710 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
19711 if (unlikely(__pyx_kwds)) {
19712 Py_ssize_t kw_args;
19713 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19714 switch (pos_args) {
19715 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19716 CYTHON_FALLTHROUGH;
19717 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19718 CYTHON_FALLTHROUGH;
19719 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19720 CYTHON_FALLTHROUGH;
19721 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19722 CYTHON_FALLTHROUGH;
19723 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19724 CYTHON_FALLTHROUGH;
19725 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19726 CYTHON_FALLTHROUGH;
19727 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19728 CYTHON_FALLTHROUGH;
19729 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19730 CYTHON_FALLTHROUGH;
19731 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19732 CYTHON_FALLTHROUGH;
19734 default:
goto __pyx_L5_argtuple_error;
19736 kw_args = PyDict_Size(__pyx_kwds);
19737 switch (pos_args) {
19739 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
19740 else goto __pyx_L5_argtuple_error;
19741 CYTHON_FALLTHROUGH;
19743 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
19745 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 1); __PYX_ERR(0, 884, __pyx_L3_error)
19747 CYTHON_FALLTHROUGH;
19749 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
19751 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 2); __PYX_ERR(0, 884, __pyx_L3_error)
19753 CYTHON_FALLTHROUGH;
19755 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
19757 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 3); __PYX_ERR(0, 884, __pyx_L3_error)
19759 CYTHON_FALLTHROUGH;
19761 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zVelocity)) != 0)) kw_args--;
19763 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 4); __PYX_ERR(0, 884, __pyx_L3_error)
19765 CYTHON_FALLTHROUGH;
19767 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
19769 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 5); __PYX_ERR(0, 884, __pyx_L3_error)
19771 CYTHON_FALLTHROUGH;
19773 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
19775 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 6); __PYX_ERR(0, 884, __pyx_L3_error)
19777 CYTHON_FALLTHROUGH;
19779 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
19781 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 7); __PYX_ERR(0, 884, __pyx_L3_error)
19783 CYTHON_FALLTHROUGH;
19785 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
19787 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 8); __PYX_ERR(0, 884, __pyx_L3_error)
19790 if (unlikely(kw_args > 0)) {
19791 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"helicalElementVelocityEval4") < 0)) __PYX_ERR(0, 884, __pyx_L3_error)
19793 }
else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
19794 goto __pyx_L5_argtuple_error;
19796 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19797 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19798 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19799 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19800 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19801 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19802 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19803 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19804 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19806 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L3_error)
19807 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L3_error)
19808 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 886, __pyx_L3_error)
19809 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L3_error)
19810 __pyx_v_zVelocity = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_zVelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L3_error)
19811 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error)
19812 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[6]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error)
19813 __pyx_v_x = ((PyArrayObject *)values[7]);
19814 __pyx_v_v = ((PyArrayObject *)values[8]);
19816 goto __pyx_L4_argument_unpacking_done;
19817 __pyx_L5_argtuple_error:;
19818 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 884, __pyx_L3_error)
19820 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19821 __Pyx_RefNannyFinishContext();
19823 __pyx_L4_argument_unpacking_done:;
19824 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 890, __pyx_L1_error)
19825 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 891, __pyx_L1_error)
19826 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_zVelocity, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v);
19833 __Pyx_RefNannyFinishContext();
19837 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
19842 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
19843 __Pyx_Buffer __pyx_pybuffer_v;
19844 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
19845 __Pyx_Buffer __pyx_pybuffer_x;
19846 PyObject *__pyx_r = NULL;
19847 __Pyx_RefNannyDeclarations
19849 npy_intp __pyx_t_2;
19850 npy_intp __pyx_t_3;
19852 npy_intp __pyx_t_5;
19853 npy_intp __pyx_t_6;
19855 npy_intp __pyx_t_8;
19856 npy_intp __pyx_t_9;
19858 Py_ssize_t __pyx_t_11;
19859 Py_ssize_t __pyx_t_12;
19860 Py_ssize_t __pyx_t_13;
19861 Py_ssize_t __pyx_t_14;
19863 Py_ssize_t __pyx_t_16;
19864 Py_ssize_t __pyx_t_17;
19865 Py_ssize_t __pyx_t_18;
19866 Py_ssize_t __pyx_t_19;
19867 Py_ssize_t __pyx_t_20;
19868 Py_ssize_t __pyx_t_21;
19869 Py_ssize_t __pyx_t_22;
19870 Py_ssize_t __pyx_t_23;
19871 Py_ssize_t __pyx_t_24;
19872 Py_ssize_t __pyx_t_25;
19873 Py_ssize_t __pyx_t_26;
19874 Py_ssize_t __pyx_t_27;
19875 Py_ssize_t __pyx_t_28;
19876 Py_ssize_t __pyx_t_29;
19877 Py_ssize_t __pyx_t_30;
19878 Py_ssize_t __pyx_t_31;
19879 PyObject *__pyx_t_32 = NULL;
19880 PyObject *__pyx_t_33 = NULL;
19881 PyObject *__pyx_t_34 = NULL;
19882 PyObject *__pyx_t_35 = NULL;
19885 Py_ssize_t __pyx_t_38;
19886 Py_ssize_t __pyx_t_39;
19887 Py_ssize_t __pyx_t_40;
19888 Py_ssize_t __pyx_t_41;
19889 Py_ssize_t __pyx_t_42;
19890 Py_ssize_t __pyx_t_43;
19891 Py_ssize_t __pyx_t_44;
19892 Py_ssize_t __pyx_t_45;
19893 Py_ssize_t __pyx_t_46;
19894 Py_ssize_t __pyx_t_47;
19895 Py_ssize_t __pyx_t_48;
19896 Py_ssize_t __pyx_t_49;
19897 Py_ssize_t __pyx_t_50;
19898 Py_ssize_t __pyx_t_51;
19899 Py_ssize_t __pyx_t_52;
19900 Py_ssize_t __pyx_t_53;
19901 Py_ssize_t __pyx_t_54;
19902 Py_ssize_t __pyx_t_55;
19903 Py_ssize_t __pyx_t_56;
19904 Py_ssize_t __pyx_t_57;
19905 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval4", 0);
19906 __pyx_pybuffer_x.pybuffer.buf = NULL;
19907 __pyx_pybuffer_x.refcount = 0;
19908 __pyx_pybuffernd_x.data = NULL;
19909 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
19910 __pyx_pybuffer_v.pybuffer.buf = NULL;
19911 __pyx_pybuffer_v.refcount = 0;
19912 __pyx_pybuffernd_v.data = NULL;
19913 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
19915 __Pyx_BufFmt_StackElem __pyx_stack[1];
19916 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 884, __pyx_L1_error)
19918 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
19920 __Pyx_BufFmt_StackElem __pyx_stack[1];
19921 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 884, __pyx_L1_error)
19923 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
19941 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
19951 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
19952 __pyx_t_3 = __pyx_t_2;
19953 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19954 __pyx_v_eN = __pyx_t_4;
19963 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
19964 __pyx_t_6 = __pyx_t_5;
19965 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
19966 __pyx_v_ebN = __pyx_t_7;
19975 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
19976 __pyx_t_9 = __pyx_t_8;
19977 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
19978 __pyx_v_k = __pyx_t_10;
19987 __pyx_t_11 = __pyx_v_eN;
19988 __pyx_t_12 = __pyx_v_ebN;
19989 __pyx_t_13 = __pyx_v_k;
19992 if (__pyx_t_11 < 0) {
19993 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
19994 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
19995 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
19996 if (__pyx_t_12 < 0) {
19997 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
19998 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
19999 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
20000 if (__pyx_t_13 < 0) {
20001 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
20002 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
20003 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
20004 if (__pyx_t_14 < 0) {
20005 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
20006 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
20007 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
20008 if (unlikely(__pyx_t_15 != -1)) {
20009 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20010 __PYX_ERR(0, 899, __pyx_L1_error)
20012 __pyx_t_16 = __pyx_v_eN;
20013 __pyx_t_17 = __pyx_v_ebN;
20014 __pyx_t_18 = __pyx_v_k;
20017 if (__pyx_t_16 < 0) {
20018 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
20019 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
20020 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20021 if (__pyx_t_17 < 0) {
20022 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
20023 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
20024 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20025 if (__pyx_t_18 < 0) {
20026 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
20027 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
20028 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20029 if (__pyx_t_19 < 0) {
20030 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
20031 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
20032 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20033 if (unlikely(__pyx_t_15 != -1)) {
20034 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20035 __PYX_ERR(0, 899, __pyx_L1_error)
20037 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
20046 __pyx_t_20 = __pyx_v_eN;
20047 __pyx_t_21 = __pyx_v_ebN;
20048 __pyx_t_22 = __pyx_v_k;
20051 if (__pyx_t_20 < 0) {
20052 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[0].shape;
20053 if (unlikely(__pyx_t_20 < 0)) __pyx_t_15 = 0;
20054 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
20055 if (__pyx_t_21 < 0) {
20056 __pyx_t_21 += __pyx_pybuffernd_x.diminfo[1].shape;
20057 if (unlikely(__pyx_t_21 < 0)) __pyx_t_15 = 1;
20058 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
20059 if (__pyx_t_22 < 0) {
20060 __pyx_t_22 += __pyx_pybuffernd_x.diminfo[2].shape;
20061 if (unlikely(__pyx_t_22 < 0)) __pyx_t_15 = 2;
20062 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
20063 if (__pyx_t_23 < 0) {
20064 __pyx_t_23 += __pyx_pybuffernd_x.diminfo[3].shape;
20065 if (unlikely(__pyx_t_23 < 0)) __pyx_t_15 = 3;
20066 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
20067 if (unlikely(__pyx_t_15 != -1)) {
20068 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20069 __PYX_ERR(0, 900, __pyx_L1_error)
20071 __pyx_t_24 = __pyx_v_eN;
20072 __pyx_t_25 = __pyx_v_ebN;
20073 __pyx_t_26 = __pyx_v_k;
20076 if (__pyx_t_24 < 0) {
20077 __pyx_t_24 += __pyx_pybuffernd_v.diminfo[0].shape;
20078 if (unlikely(__pyx_t_24 < 0)) __pyx_t_15 = 0;
20079 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20080 if (__pyx_t_25 < 0) {
20081 __pyx_t_25 += __pyx_pybuffernd_v.diminfo[1].shape;
20082 if (unlikely(__pyx_t_25 < 0)) __pyx_t_15 = 1;
20083 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20084 if (__pyx_t_26 < 0) {
20085 __pyx_t_26 += __pyx_pybuffernd_v.diminfo[2].shape;
20086 if (unlikely(__pyx_t_26 < 0)) __pyx_t_15 = 2;
20087 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20088 if (__pyx_t_27 < 0) {
20089 __pyx_t_27 += __pyx_pybuffernd_v.diminfo[3].shape;
20090 if (unlikely(__pyx_t_27 < 0)) __pyx_t_15 = 3;
20091 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20092 if (unlikely(__pyx_t_15 != -1)) {
20093 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20094 __PYX_ERR(0, 900, __pyx_L1_error)
20096 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_26, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_27, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_23, __pyx_pybuffernd_x.diminfo[3].strides))));
20105 __pyx_t_28 = __pyx_v_eN;
20106 __pyx_t_29 = __pyx_v_ebN;
20107 __pyx_t_30 = __pyx_v_k;
20110 if (__pyx_t_28 < 0) {
20111 __pyx_t_28 += __pyx_pybuffernd_v.diminfo[0].shape;
20112 if (unlikely(__pyx_t_28 < 0)) __pyx_t_15 = 0;
20113 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20114 if (__pyx_t_29 < 0) {
20115 __pyx_t_29 += __pyx_pybuffernd_v.diminfo[1].shape;
20116 if (unlikely(__pyx_t_29 < 0)) __pyx_t_15 = 1;
20117 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20118 if (__pyx_t_30 < 0) {
20119 __pyx_t_30 += __pyx_pybuffernd_v.diminfo[2].shape;
20120 if (unlikely(__pyx_t_30 < 0)) __pyx_t_15 = 2;
20121 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20122 if (__pyx_t_31 < 0) {
20123 __pyx_t_31 += __pyx_pybuffernd_v.diminfo[3].shape;
20124 if (unlikely(__pyx_t_31 < 0)) __pyx_t_15 = 3;
20125 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20126 if (unlikely(__pyx_t_15 != -1)) {
20127 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20128 __PYX_ERR(0, 901, __pyx_L1_error)
20130 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_31, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zVelocity;
20139 __pyx_t_32 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 902, __pyx_L1_error)
20140 __Pyx_GOTREF(__pyx_t_32);
20141 __pyx_t_33 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 902, __pyx_L1_error)
20142 __Pyx_GOTREF(__pyx_t_33);
20143 __pyx_t_34 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 902, __pyx_L1_error)
20144 __Pyx_GOTREF(__pyx_t_34);
20145 __pyx_t_35 = PyTuple_New(4);
if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 902, __pyx_L1_error)
20146 __Pyx_GOTREF(__pyx_t_35);
20147 __Pyx_GIVEREF(__pyx_t_32);
20148 PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_32);
20149 __Pyx_GIVEREF(__pyx_t_33);
20150 PyTuple_SET_ITEM(__pyx_t_35, 1, __pyx_t_33);
20151 __Pyx_GIVEREF(__pyx_t_34);
20152 PyTuple_SET_ITEM(__pyx_t_35, 2, __pyx_t_34);
20153 __Pyx_INCREF(__pyx_slice_);
20154 __Pyx_GIVEREF(__pyx_slice_);
20155 PyTuple_SET_ITEM(__pyx_t_35, 3, __pyx_slice_);
20159 __pyx_t_34 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_35);
if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 902, __pyx_L1_error)
20160 __Pyx_GOTREF(__pyx_t_34);
20161 __pyx_t_36 = (__pyx_v_pi * __pyx_v_t);
20162 __pyx_t_37 = (__pyx_v_tForReversal * 2.0);
20163 if (unlikely(__pyx_t_37 == 0)) {
20164 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
20165 __PYX_ERR(0, 902, __pyx_L1_error)
20167 __pyx_t_33 = PyFloat_FromDouble((__pyx_v_clock * cos((__pyx_t_36 / __pyx_t_37))));
if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 902, __pyx_L1_error)
20168 __Pyx_GOTREF(__pyx_t_33);
20169 __pyx_t_32 = PyNumber_InPlaceMultiply(__pyx_t_34, __pyx_t_33);
if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 902, __pyx_L1_error)
20170 __Pyx_GOTREF(__pyx_t_32);
20171 __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
20172 __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
20173 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_35, __pyx_t_32) < 0)) __PYX_ERR(0, 902, __pyx_L1_error)
20174 __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
20175 __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
20198 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
20199 __pyx_t_3 = __pyx_t_2;
20200 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20201 __pyx_v_eN = __pyx_t_4;
20210 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
20211 __pyx_t_6 = __pyx_t_5;
20212 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
20213 __pyx_v_ebN = __pyx_t_7;
20222 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
20223 __pyx_t_9 = __pyx_t_8;
20224 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
20225 __pyx_v_k = __pyx_t_10;
20234 __pyx_t_38 = __pyx_v_eN;
20235 __pyx_t_39 = __pyx_v_ebN;
20236 __pyx_t_40 = __pyx_v_k;
20239 if (__pyx_t_38 < 0) {
20240 __pyx_t_38 += __pyx_pybuffernd_x.diminfo[0].shape;
20241 if (unlikely(__pyx_t_38 < 0)) __pyx_t_15 = 0;
20242 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
20243 if (__pyx_t_39 < 0) {
20244 __pyx_t_39 += __pyx_pybuffernd_x.diminfo[1].shape;
20245 if (unlikely(__pyx_t_39 < 0)) __pyx_t_15 = 1;
20246 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
20247 if (__pyx_t_40 < 0) {
20248 __pyx_t_40 += __pyx_pybuffernd_x.diminfo[2].shape;
20249 if (unlikely(__pyx_t_40 < 0)) __pyx_t_15 = 2;
20250 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
20251 if (__pyx_t_41 < 0) {
20252 __pyx_t_41 += __pyx_pybuffernd_x.diminfo[3].shape;
20253 if (unlikely(__pyx_t_41 < 0)) __pyx_t_15 = 3;
20254 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
20255 if (unlikely(__pyx_t_15 != -1)) {
20256 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20257 __PYX_ERR(0, 907, __pyx_L1_error)
20259 __pyx_t_42 = __pyx_v_eN;
20260 __pyx_t_43 = __pyx_v_ebN;
20261 __pyx_t_44 = __pyx_v_k;
20264 if (__pyx_t_42 < 0) {
20265 __pyx_t_42 += __pyx_pybuffernd_v.diminfo[0].shape;
20266 if (unlikely(__pyx_t_42 < 0)) __pyx_t_15 = 0;
20267 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20268 if (__pyx_t_43 < 0) {
20269 __pyx_t_43 += __pyx_pybuffernd_v.diminfo[1].shape;
20270 if (unlikely(__pyx_t_43 < 0)) __pyx_t_15 = 1;
20271 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20272 if (__pyx_t_44 < 0) {
20273 __pyx_t_44 += __pyx_pybuffernd_v.diminfo[2].shape;
20274 if (unlikely(__pyx_t_44 < 0)) __pyx_t_15 = 2;
20275 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20276 if (__pyx_t_45 < 0) {
20277 __pyx_t_45 += __pyx_pybuffernd_v.diminfo[3].shape;
20278 if (unlikely(__pyx_t_45 < 0)) __pyx_t_15 = 3;
20279 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20280 if (unlikely(__pyx_t_15 != -1)) {
20281 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20282 __PYX_ERR(0, 907, __pyx_L1_error)
20284 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_44, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_45, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_40, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_41, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
20293 __pyx_t_46 = __pyx_v_eN;
20294 __pyx_t_47 = __pyx_v_ebN;
20295 __pyx_t_48 = __pyx_v_k;
20298 if (__pyx_t_46 < 0) {
20299 __pyx_t_46 += __pyx_pybuffernd_x.diminfo[0].shape;
20300 if (unlikely(__pyx_t_46 < 0)) __pyx_t_15 = 0;
20301 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
20302 if (__pyx_t_47 < 0) {
20303 __pyx_t_47 += __pyx_pybuffernd_x.diminfo[1].shape;
20304 if (unlikely(__pyx_t_47 < 0)) __pyx_t_15 = 1;
20305 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
20306 if (__pyx_t_48 < 0) {
20307 __pyx_t_48 += __pyx_pybuffernd_x.diminfo[2].shape;
20308 if (unlikely(__pyx_t_48 < 0)) __pyx_t_15 = 2;
20309 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
20310 if (__pyx_t_49 < 0) {
20311 __pyx_t_49 += __pyx_pybuffernd_x.diminfo[3].shape;
20312 if (unlikely(__pyx_t_49 < 0)) __pyx_t_15 = 3;
20313 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
20314 if (unlikely(__pyx_t_15 != -1)) {
20315 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20316 __PYX_ERR(0, 908, __pyx_L1_error)
20318 __pyx_t_50 = __pyx_v_eN;
20319 __pyx_t_51 = __pyx_v_ebN;
20320 __pyx_t_52 = __pyx_v_k;
20323 if (__pyx_t_50 < 0) {
20324 __pyx_t_50 += __pyx_pybuffernd_v.diminfo[0].shape;
20325 if (unlikely(__pyx_t_50 < 0)) __pyx_t_15 = 0;
20326 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20327 if (__pyx_t_51 < 0) {
20328 __pyx_t_51 += __pyx_pybuffernd_v.diminfo[1].shape;
20329 if (unlikely(__pyx_t_51 < 0)) __pyx_t_15 = 1;
20330 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20331 if (__pyx_t_52 < 0) {
20332 __pyx_t_52 += __pyx_pybuffernd_v.diminfo[2].shape;
20333 if (unlikely(__pyx_t_52 < 0)) __pyx_t_15 = 2;
20334 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20335 if (__pyx_t_53 < 0) {
20336 __pyx_t_53 += __pyx_pybuffernd_v.diminfo[3].shape;
20337 if (unlikely(__pyx_t_53 < 0)) __pyx_t_15 = 3;
20338 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20339 if (unlikely(__pyx_t_15 != -1)) {
20340 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20341 __PYX_ERR(0, 908, __pyx_L1_error)
20343 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_52, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_53, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_48, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_49, __pyx_pybuffernd_x.diminfo[3].strides))));
20352 __pyx_t_54 = __pyx_v_eN;
20353 __pyx_t_55 = __pyx_v_ebN;
20354 __pyx_t_56 = __pyx_v_k;
20357 if (__pyx_t_54 < 0) {
20358 __pyx_t_54 += __pyx_pybuffernd_v.diminfo[0].shape;
20359 if (unlikely(__pyx_t_54 < 0)) __pyx_t_15 = 0;
20360 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20361 if (__pyx_t_55 < 0) {
20362 __pyx_t_55 += __pyx_pybuffernd_v.diminfo[1].shape;
20363 if (unlikely(__pyx_t_55 < 0)) __pyx_t_15 = 1;
20364 }
else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20365 if (__pyx_t_56 < 0) {
20366 __pyx_t_56 += __pyx_pybuffernd_v.diminfo[2].shape;
20367 if (unlikely(__pyx_t_56 < 0)) __pyx_t_15 = 2;
20368 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20369 if (__pyx_t_57 < 0) {
20370 __pyx_t_57 += __pyx_pybuffernd_v.diminfo[3].shape;
20371 if (unlikely(__pyx_t_57 < 0)) __pyx_t_15 = 3;
20372 }
else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20373 if (unlikely(__pyx_t_15 != -1)) {
20374 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20375 __PYX_ERR(0, 909, __pyx_L1_error)
20377 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_55, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_56, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_57, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zVelocity;
20393 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20396 __Pyx_XDECREF(__pyx_t_32);
20397 __Pyx_XDECREF(__pyx_t_33);
20398 __Pyx_XDECREF(__pyx_t_34);
20399 __Pyx_XDECREF(__pyx_t_35);
20400 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
20401 __Pyx_PyThreadState_declare
20402 __Pyx_PyThreadState_assign
20403 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
20404 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20405 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20406 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
20407 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20411 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20412 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20414 __Pyx_XGIVEREF(__pyx_r);
20415 __Pyx_RefNannyFinishContext();
20428 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20429 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_55vortexElementVelocityEval3 = {
"vortexElementVelocityEval3", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
20430 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20432 PyArrayObject *__pyx_v_x = 0;
20433 PyArrayObject *__pyx_v_v = 0;
20434 PyObject *__pyx_r = 0;
20435 __Pyx_RefNannyDeclarations
20436 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval3 (wrapper)", 0);
20438 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_v,0};
20439 PyObject* values[3] = {0,0,0};
20440 if (unlikely(__pyx_kwds)) {
20441 Py_ssize_t kw_args;
20442 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20443 switch (pos_args) {
20444 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20445 CYTHON_FALLTHROUGH;
20446 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20447 CYTHON_FALLTHROUGH;
20448 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20449 CYTHON_FALLTHROUGH;
20451 default:
goto __pyx_L5_argtuple_error;
20453 kw_args = PyDict_Size(__pyx_kwds);
20454 switch (pos_args) {
20456 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
20457 else goto __pyx_L5_argtuple_error;
20458 CYTHON_FALLTHROUGH;
20460 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
20462 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, 1); __PYX_ERR(0, 911, __pyx_L3_error)
20464 CYTHON_FALLTHROUGH;
20466 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
20468 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, 2); __PYX_ERR(0, 911, __pyx_L3_error)
20471 if (unlikely(kw_args > 0)) {
20472 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vortexElementVelocityEval3") < 0)) __PYX_ERR(0, 911, __pyx_L3_error)
20474 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20475 goto __pyx_L5_argtuple_error;
20477 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20478 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20479 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20481 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 911, __pyx_L3_error)
20482 __pyx_v_x = ((PyArrayObject *)values[1]);
20483 __pyx_v_v = ((PyArrayObject *)values[2]);
20485 goto __pyx_L4_argument_unpacking_done;
20486 __pyx_L5_argtuple_error:;
20487 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 911, __pyx_L3_error)
20489 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
20490 __Pyx_RefNannyFinishContext();
20492 __pyx_L4_argument_unpacking_done:;
20493 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 912, __pyx_L1_error)
20494 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 913, __pyx_L1_error)
20495 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(__pyx_self, __pyx_v_t, __pyx_v_x, __pyx_v_v);
20502 __Pyx_RefNannyFinishContext();
20506 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
20510 double __pyx_v_one8;
20511 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
20512 __Pyx_Buffer __pyx_pybuffer_v;
20513 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
20514 __Pyx_Buffer __pyx_pybuffer_x;
20515 PyObject *__pyx_r = NULL;
20516 __Pyx_RefNannyDeclarations
20517 npy_intp __pyx_t_1;
20518 npy_intp __pyx_t_2;
20520 npy_intp __pyx_t_4;
20521 npy_intp __pyx_t_5;
20523 Py_ssize_t __pyx_t_7;
20524 Py_ssize_t __pyx_t_8;
20525 Py_ssize_t __pyx_t_9;
20527 Py_ssize_t __pyx_t_11;
20528 Py_ssize_t __pyx_t_12;
20529 Py_ssize_t __pyx_t_13;
20530 Py_ssize_t __pyx_t_14;
20531 Py_ssize_t __pyx_t_15;
20532 Py_ssize_t __pyx_t_16;
20533 Py_ssize_t __pyx_t_17;
20534 Py_ssize_t __pyx_t_18;
20535 Py_ssize_t __pyx_t_19;
20536 Py_ssize_t __pyx_t_20;
20537 Py_ssize_t __pyx_t_21;
20538 Py_ssize_t __pyx_t_22;
20539 Py_ssize_t __pyx_t_23;
20540 Py_ssize_t __pyx_t_24;
20541 Py_ssize_t __pyx_t_25;
20542 Py_ssize_t __pyx_t_26;
20543 Py_ssize_t __pyx_t_27;
20544 Py_ssize_t __pyx_t_28;
20545 Py_ssize_t __pyx_t_29;
20546 Py_ssize_t __pyx_t_30;
20547 Py_ssize_t __pyx_t_31;
20548 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval3", 0);
20549 __pyx_pybuffer_x.pybuffer.buf = NULL;
20550 __pyx_pybuffer_x.refcount = 0;
20551 __pyx_pybuffernd_x.data = NULL;
20552 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
20553 __pyx_pybuffer_v.pybuffer.buf = NULL;
20554 __pyx_pybuffer_v.refcount = 0;
20555 __pyx_pybuffernd_v.data = NULL;
20556 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
20558 __Pyx_BufFmt_StackElem __pyx_stack[1];
20559 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 911, __pyx_L1_error)
20561 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
20563 __Pyx_BufFmt_StackElem __pyx_stack[1];
20564 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 911, __pyx_L1_error)
20566 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
20584 __pyx_v_one8 = (1.0 / 8.0);
20593 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
20594 __pyx_t_2 = __pyx_t_1;
20595 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20596 __pyx_v_eN = __pyx_t_3;
20605 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
20606 __pyx_t_5 = __pyx_t_4;
20607 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20608 __pyx_v_k = __pyx_t_6;
20617 __pyx_t_7 = __pyx_v_eN;
20618 __pyx_t_8 = __pyx_v_k;
20621 if (__pyx_t_7 < 0) {
20622 __pyx_t_7 += __pyx_pybuffernd_x.diminfo[0].shape;
20623 if (unlikely(__pyx_t_7 < 0)) __pyx_t_10 = 0;
20624 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20625 if (__pyx_t_8 < 0) {
20626 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[1].shape;
20627 if (unlikely(__pyx_t_8 < 0)) __pyx_t_10 = 1;
20628 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20629 if (__pyx_t_9 < 0) {
20630 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[2].shape;
20631 if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 2;
20632 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20633 if (unlikely(__pyx_t_10 != -1)) {
20634 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20635 __PYX_ERR(0, 920, __pyx_L1_error)
20637 __pyx_t_11 = __pyx_v_eN;
20638 __pyx_t_12 = __pyx_v_k;
20641 if (__pyx_t_11 < 0) {
20642 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
20643 if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 0;
20644 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20645 if (__pyx_t_12 < 0) {
20646 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
20647 if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 1;
20648 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20649 if (__pyx_t_13 < 0) {
20650 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
20651 if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 2;
20652 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20653 if (unlikely(__pyx_t_10 != -1)) {
20654 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20655 __PYX_ERR(0, 920, __pyx_L1_error)
20657 __pyx_t_14 = __pyx_v_eN;
20658 __pyx_t_15 = __pyx_v_k;
20661 if (__pyx_t_14 < 0) {
20662 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
20663 if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 0;
20664 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20665 if (__pyx_t_15 < 0) {
20666 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[1].shape;
20667 if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 1;
20668 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20669 if (__pyx_t_16 < 0) {
20670 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[2].shape;
20671 if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 2;
20672 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20673 if (unlikely(__pyx_t_10 != -1)) {
20674 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20675 __PYX_ERR(0, 920, __pyx_L1_error)
20677 __pyx_t_17 = __pyx_v_eN;
20678 __pyx_t_18 = __pyx_v_k;
20681 if (__pyx_t_17 < 0) {
20682 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[0].shape;
20683 if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0;
20684 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_10 = 0;
20685 if (__pyx_t_18 < 0) {
20686 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
20687 if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 1;
20688 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_10 = 1;
20689 if (__pyx_t_19 < 0) {
20690 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[2].shape;
20691 if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 2;
20692 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_10 = 2;
20693 if (unlikely(__pyx_t_10 != -1)) {
20694 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20695 __PYX_ERR(0, 920, __pyx_L1_error)
20697 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[2].strides) = (((cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t)) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[2].strides)))));
20706 __pyx_t_20 = __pyx_v_eN;
20707 __pyx_t_21 = __pyx_v_k;
20710 if (__pyx_t_20 < 0) {
20711 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[0].shape;
20712 if (unlikely(__pyx_t_20 < 0)) __pyx_t_10 = 0;
20713 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20714 if (__pyx_t_21 < 0) {
20715 __pyx_t_21 += __pyx_pybuffernd_x.diminfo[1].shape;
20716 if (unlikely(__pyx_t_21 < 0)) __pyx_t_10 = 1;
20717 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20718 if (__pyx_t_22 < 0) {
20719 __pyx_t_22 += __pyx_pybuffernd_x.diminfo[2].shape;
20720 if (unlikely(__pyx_t_22 < 0)) __pyx_t_10 = 2;
20721 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20722 if (unlikely(__pyx_t_10 != -1)) {
20723 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20724 __PYX_ERR(0, 921, __pyx_L1_error)
20726 __pyx_t_23 = __pyx_v_eN;
20727 __pyx_t_24 = __pyx_v_k;
20730 if (__pyx_t_23 < 0) {
20731 __pyx_t_23 += __pyx_pybuffernd_x.diminfo[0].shape;
20732 if (unlikely(__pyx_t_23 < 0)) __pyx_t_10 = 0;
20733 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20734 if (__pyx_t_24 < 0) {
20735 __pyx_t_24 += __pyx_pybuffernd_x.diminfo[1].shape;
20736 if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 1;
20737 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20738 if (__pyx_t_25 < 0) {
20739 __pyx_t_25 += __pyx_pybuffernd_x.diminfo[2].shape;
20740 if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 2;
20741 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20742 if (unlikely(__pyx_t_10 != -1)) {
20743 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20744 __PYX_ERR(0, 921, __pyx_L1_error)
20746 __pyx_t_26 = __pyx_v_eN;
20747 __pyx_t_27 = __pyx_v_k;
20750 if (__pyx_t_26 < 0) {
20751 __pyx_t_26 += __pyx_pybuffernd_x.diminfo[0].shape;
20752 if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 0;
20753 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20754 if (__pyx_t_27 < 0) {
20755 __pyx_t_27 += __pyx_pybuffernd_x.diminfo[1].shape;
20756 if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 1;
20757 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20758 if (__pyx_t_28 < 0) {
20759 __pyx_t_28 += __pyx_pybuffernd_x.diminfo[2].shape;
20760 if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 2;
20761 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20762 if (unlikely(__pyx_t_10 != -1)) {
20763 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20764 __PYX_ERR(0, 921, __pyx_L1_error)
20766 __pyx_t_29 = __pyx_v_eN;
20767 __pyx_t_30 = __pyx_v_k;
20770 if (__pyx_t_29 < 0) {
20771 __pyx_t_29 += __pyx_pybuffernd_v.diminfo[0].shape;
20772 if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0;
20773 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_10 = 0;
20774 if (__pyx_t_30 < 0) {
20775 __pyx_t_30 += __pyx_pybuffernd_v.diminfo[1].shape;
20776 if (unlikely(__pyx_t_30 < 0)) __pyx_t_10 = 1;
20777 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_10 = 1;
20778 if (__pyx_t_31 < 0) {
20779 __pyx_t_31 += __pyx_pybuffernd_v.diminfo[2].shape;
20780 if (unlikely(__pyx_t_31 < 0)) __pyx_t_10 = 2;
20781 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_10 = 2;
20782 if (unlikely(__pyx_t_10 != -1)) {
20783 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20784 __PYX_ERR(0, 921, __pyx_L1_error)
20786 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_31, __pyx_pybuffernd_v.diminfo[2].strides) = ((((-cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t))) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_28, __pyx_pybuffernd_x.diminfo[2].strides)))));
20799 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20802 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
20803 __Pyx_PyThreadState_declare
20804 __Pyx_PyThreadState_assign
20805 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
20806 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20807 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20808 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
20809 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
20813 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20814 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20816 __Pyx_XGIVEREF(__pyx_r);
20817 __Pyx_RefNannyFinishContext();
20830 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20831 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_57vortexElementVelocityEval4 = {
"vortexElementVelocityEval4", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
20832 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20834 PyArrayObject *__pyx_v_x = 0;
20835 PyArrayObject *__pyx_v_v = 0;
20836 PyObject *__pyx_r = 0;
20837 __Pyx_RefNannyDeclarations
20838 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval4 (wrapper)", 0);
20840 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_v,0};
20841 PyObject* values[3] = {0,0,0};
20842 if (unlikely(__pyx_kwds)) {
20843 Py_ssize_t kw_args;
20844 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20845 switch (pos_args) {
20846 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20847 CYTHON_FALLTHROUGH;
20848 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20849 CYTHON_FALLTHROUGH;
20850 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20851 CYTHON_FALLTHROUGH;
20853 default:
goto __pyx_L5_argtuple_error;
20855 kw_args = PyDict_Size(__pyx_kwds);
20856 switch (pos_args) {
20858 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
20859 else goto __pyx_L5_argtuple_error;
20860 CYTHON_FALLTHROUGH;
20862 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
20864 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, 1); __PYX_ERR(0, 924, __pyx_L3_error)
20866 CYTHON_FALLTHROUGH;
20868 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
20870 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, 2); __PYX_ERR(0, 924, __pyx_L3_error)
20873 if (unlikely(kw_args > 0)) {
20874 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vortexElementVelocityEval4") < 0)) __PYX_ERR(0, 924, __pyx_L3_error)
20876 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20877 goto __pyx_L5_argtuple_error;
20879 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20880 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20881 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20883 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 924, __pyx_L3_error)
20884 __pyx_v_x = ((PyArrayObject *)values[1]);
20885 __pyx_v_v = ((PyArrayObject *)values[2]);
20887 goto __pyx_L4_argument_unpacking_done;
20888 __pyx_L5_argtuple_error:;
20889 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 924, __pyx_L3_error)
20891 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20892 __Pyx_RefNannyFinishContext();
20894 __pyx_L4_argument_unpacking_done:;
20895 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 925, __pyx_L1_error)
20896 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 926, __pyx_L1_error)
20897 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(__pyx_self, __pyx_v_t, __pyx_v_x, __pyx_v_v);
20904 __Pyx_RefNannyFinishContext();
20908 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
20913 double __pyx_v_one8;
20914 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
20915 __Pyx_Buffer __pyx_pybuffer_v;
20916 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
20917 __Pyx_Buffer __pyx_pybuffer_x;
20918 PyObject *__pyx_r = NULL;
20919 __Pyx_RefNannyDeclarations
20920 npy_intp __pyx_t_1;
20921 npy_intp __pyx_t_2;
20923 npy_intp __pyx_t_4;
20924 npy_intp __pyx_t_5;
20926 npy_intp __pyx_t_7;
20927 npy_intp __pyx_t_8;
20929 Py_ssize_t __pyx_t_10;
20930 Py_ssize_t __pyx_t_11;
20931 Py_ssize_t __pyx_t_12;
20932 Py_ssize_t __pyx_t_13;
20934 Py_ssize_t __pyx_t_15;
20935 Py_ssize_t __pyx_t_16;
20936 Py_ssize_t __pyx_t_17;
20937 Py_ssize_t __pyx_t_18;
20938 Py_ssize_t __pyx_t_19;
20939 Py_ssize_t __pyx_t_20;
20940 Py_ssize_t __pyx_t_21;
20941 Py_ssize_t __pyx_t_22;
20942 Py_ssize_t __pyx_t_23;
20943 Py_ssize_t __pyx_t_24;
20944 Py_ssize_t __pyx_t_25;
20945 Py_ssize_t __pyx_t_26;
20946 Py_ssize_t __pyx_t_27;
20947 Py_ssize_t __pyx_t_28;
20948 Py_ssize_t __pyx_t_29;
20949 Py_ssize_t __pyx_t_30;
20950 Py_ssize_t __pyx_t_31;
20951 Py_ssize_t __pyx_t_32;
20952 Py_ssize_t __pyx_t_33;
20953 Py_ssize_t __pyx_t_34;
20954 Py_ssize_t __pyx_t_35;
20955 Py_ssize_t __pyx_t_36;
20956 Py_ssize_t __pyx_t_37;
20957 Py_ssize_t __pyx_t_38;
20958 Py_ssize_t __pyx_t_39;
20959 Py_ssize_t __pyx_t_40;
20960 Py_ssize_t __pyx_t_41;
20961 Py_ssize_t __pyx_t_42;
20962 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval4", 0);
20963 __pyx_pybuffer_x.pybuffer.buf = NULL;
20964 __pyx_pybuffer_x.refcount = 0;
20965 __pyx_pybuffernd_x.data = NULL;
20966 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
20967 __pyx_pybuffer_v.pybuffer.buf = NULL;
20968 __pyx_pybuffer_v.refcount = 0;
20969 __pyx_pybuffernd_v.data = NULL;
20970 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
20972 __Pyx_BufFmt_StackElem __pyx_stack[1];
20973 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 924, __pyx_L1_error)
20975 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
20977 __Pyx_BufFmt_StackElem __pyx_stack[1];
20978 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 924, __pyx_L1_error)
20980 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
20998 __pyx_v_one8 = (1.0 / 8.0);
21007 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
21008 __pyx_t_2 = __pyx_t_1;
21009 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21010 __pyx_v_eN = __pyx_t_3;
21019 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
21020 __pyx_t_5 = __pyx_t_4;
21021 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
21022 __pyx_v_ebN = __pyx_t_6;
21031 __pyx_t_7 = (__pyx_v_x->dimensions[2]);
21032 __pyx_t_8 = __pyx_t_7;
21033 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
21034 __pyx_v_k = __pyx_t_9;
21043 __pyx_t_10 = __pyx_v_eN;
21044 __pyx_t_11 = __pyx_v_ebN;
21045 __pyx_t_12 = __pyx_v_k;
21048 if (__pyx_t_10 < 0) {
21049 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
21050 if (unlikely(__pyx_t_10 < 0)) __pyx_t_14 = 0;
21051 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
21052 if (__pyx_t_11 < 0) {
21053 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[1].shape;
21054 if (unlikely(__pyx_t_11 < 0)) __pyx_t_14 = 1;
21055 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
21056 if (__pyx_t_12 < 0) {
21057 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
21058 if (unlikely(__pyx_t_12 < 0)) __pyx_t_14 = 2;
21059 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
21060 if (__pyx_t_13 < 0) {
21061 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[3].shape;
21062 if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 3;
21063 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
21064 if (unlikely(__pyx_t_14 != -1)) {
21065 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21066 __PYX_ERR(0, 934, __pyx_L1_error)
21068 __pyx_t_15 = __pyx_v_eN;
21069 __pyx_t_16 = __pyx_v_ebN;
21070 __pyx_t_17 = __pyx_v_k;
21073 if (__pyx_t_15 < 0) {
21074 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[0].shape;
21075 if (unlikely(__pyx_t_15 < 0)) __pyx_t_14 = 0;
21076 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
21077 if (__pyx_t_16 < 0) {
21078 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[1].shape;
21079 if (unlikely(__pyx_t_16 < 0)) __pyx_t_14 = 1;
21080 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
21081 if (__pyx_t_17 < 0) {
21082 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[2].shape;
21083 if (unlikely(__pyx_t_17 < 0)) __pyx_t_14 = 2;
21084 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
21085 if (__pyx_t_18 < 0) {
21086 __pyx_t_18 += __pyx_pybuffernd_x.diminfo[3].shape;
21087 if (unlikely(__pyx_t_18 < 0)) __pyx_t_14 = 3;
21088 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
21089 if (unlikely(__pyx_t_14 != -1)) {
21090 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21091 __PYX_ERR(0, 934, __pyx_L1_error)
21093 __pyx_t_19 = __pyx_v_eN;
21094 __pyx_t_20 = __pyx_v_ebN;
21095 __pyx_t_21 = __pyx_v_k;
21098 if (__pyx_t_19 < 0) {
21099 __pyx_t_19 += __pyx_pybuffernd_x.diminfo[0].shape;
21100 if (unlikely(__pyx_t_19 < 0)) __pyx_t_14 = 0;
21101 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
21102 if (__pyx_t_20 < 0) {
21103 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[1].shape;
21104 if (unlikely(__pyx_t_20 < 0)) __pyx_t_14 = 1;
21105 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
21106 if (__pyx_t_21 < 0) {
21107 __pyx_t_21 += __pyx_pybuffernd_x.diminfo[2].shape;
21108 if (unlikely(__pyx_t_21 < 0)) __pyx_t_14 = 2;
21109 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
21110 if (__pyx_t_22 < 0) {
21111 __pyx_t_22 += __pyx_pybuffernd_x.diminfo[3].shape;
21112 if (unlikely(__pyx_t_22 < 0)) __pyx_t_14 = 3;
21113 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
21114 if (unlikely(__pyx_t_14 != -1)) {
21115 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21116 __PYX_ERR(0, 934, __pyx_L1_error)
21118 __pyx_t_23 = __pyx_v_eN;
21119 __pyx_t_24 = __pyx_v_ebN;
21120 __pyx_t_25 = __pyx_v_k;
21123 if (__pyx_t_23 < 0) {
21124 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[0].shape;
21125 if (unlikely(__pyx_t_23 < 0)) __pyx_t_14 = 0;
21126 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_14 = 0;
21127 if (__pyx_t_24 < 0) {
21128 __pyx_t_24 += __pyx_pybuffernd_v.diminfo[1].shape;
21129 if (unlikely(__pyx_t_24 < 0)) __pyx_t_14 = 1;
21130 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_14 = 1;
21131 if (__pyx_t_25 < 0) {
21132 __pyx_t_25 += __pyx_pybuffernd_v.diminfo[2].shape;
21133 if (unlikely(__pyx_t_25 < 0)) __pyx_t_14 = 2;
21134 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_14 = 2;
21135 if (__pyx_t_26 < 0) {
21136 __pyx_t_26 += __pyx_pybuffernd_v.diminfo[3].shape;
21137 if (unlikely(__pyx_t_26 < 0)) __pyx_t_14 = 3;
21138 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_14 = 3;
21139 if (unlikely(__pyx_t_14 != -1)) {
21140 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21141 __PYX_ERR(0, 934, __pyx_L1_error)
21143 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_26, __pyx_pybuffernd_v.diminfo[3].strides) = (((cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t)) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_18, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_22, __pyx_pybuffernd_x.diminfo[3].strides)))));
21152 __pyx_t_27 = __pyx_v_eN;
21153 __pyx_t_28 = __pyx_v_ebN;
21154 __pyx_t_29 = __pyx_v_k;
21157 if (__pyx_t_27 < 0) {
21158 __pyx_t_27 += __pyx_pybuffernd_x.diminfo[0].shape;
21159 if (unlikely(__pyx_t_27 < 0)) __pyx_t_14 = 0;
21160 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
21161 if (__pyx_t_28 < 0) {
21162 __pyx_t_28 += __pyx_pybuffernd_x.diminfo[1].shape;
21163 if (unlikely(__pyx_t_28 < 0)) __pyx_t_14 = 1;
21164 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
21165 if (__pyx_t_29 < 0) {
21166 __pyx_t_29 += __pyx_pybuffernd_x.diminfo[2].shape;
21167 if (unlikely(__pyx_t_29 < 0)) __pyx_t_14 = 2;
21168 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
21169 if (__pyx_t_30 < 0) {
21170 __pyx_t_30 += __pyx_pybuffernd_x.diminfo[3].shape;
21171 if (unlikely(__pyx_t_30 < 0)) __pyx_t_14 = 3;
21172 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
21173 if (unlikely(__pyx_t_14 != -1)) {
21174 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21175 __PYX_ERR(0, 935, __pyx_L1_error)
21177 __pyx_t_31 = __pyx_v_eN;
21178 __pyx_t_32 = __pyx_v_ebN;
21179 __pyx_t_33 = __pyx_v_k;
21182 if (__pyx_t_31 < 0) {
21183 __pyx_t_31 += __pyx_pybuffernd_x.diminfo[0].shape;
21184 if (unlikely(__pyx_t_31 < 0)) __pyx_t_14 = 0;
21185 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
21186 if (__pyx_t_32 < 0) {
21187 __pyx_t_32 += __pyx_pybuffernd_x.diminfo[1].shape;
21188 if (unlikely(__pyx_t_32 < 0)) __pyx_t_14 = 1;
21189 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
21190 if (__pyx_t_33 < 0) {
21191 __pyx_t_33 += __pyx_pybuffernd_x.diminfo[2].shape;
21192 if (unlikely(__pyx_t_33 < 0)) __pyx_t_14 = 2;
21193 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
21194 if (__pyx_t_34 < 0) {
21195 __pyx_t_34 += __pyx_pybuffernd_x.diminfo[3].shape;
21196 if (unlikely(__pyx_t_34 < 0)) __pyx_t_14 = 3;
21197 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
21198 if (unlikely(__pyx_t_14 != -1)) {
21199 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21200 __PYX_ERR(0, 935, __pyx_L1_error)
21202 __pyx_t_35 = __pyx_v_eN;
21203 __pyx_t_36 = __pyx_v_ebN;
21204 __pyx_t_37 = __pyx_v_k;
21207 if (__pyx_t_35 < 0) {
21208 __pyx_t_35 += __pyx_pybuffernd_x.diminfo[0].shape;
21209 if (unlikely(__pyx_t_35 < 0)) __pyx_t_14 = 0;
21210 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
21211 if (__pyx_t_36 < 0) {
21212 __pyx_t_36 += __pyx_pybuffernd_x.diminfo[1].shape;
21213 if (unlikely(__pyx_t_36 < 0)) __pyx_t_14 = 1;
21214 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
21215 if (__pyx_t_37 < 0) {
21216 __pyx_t_37 += __pyx_pybuffernd_x.diminfo[2].shape;
21217 if (unlikely(__pyx_t_37 < 0)) __pyx_t_14 = 2;
21218 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
21219 if (__pyx_t_38 < 0) {
21220 __pyx_t_38 += __pyx_pybuffernd_x.diminfo[3].shape;
21221 if (unlikely(__pyx_t_38 < 0)) __pyx_t_14 = 3;
21222 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
21223 if (unlikely(__pyx_t_14 != -1)) {
21224 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21225 __PYX_ERR(0, 935, __pyx_L1_error)
21227 __pyx_t_39 = __pyx_v_eN;
21228 __pyx_t_40 = __pyx_v_ebN;
21229 __pyx_t_41 = __pyx_v_k;
21232 if (__pyx_t_39 < 0) {
21233 __pyx_t_39 += __pyx_pybuffernd_v.diminfo[0].shape;
21234 if (unlikely(__pyx_t_39 < 0)) __pyx_t_14 = 0;
21235 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_14 = 0;
21236 if (__pyx_t_40 < 0) {
21237 __pyx_t_40 += __pyx_pybuffernd_v.diminfo[1].shape;
21238 if (unlikely(__pyx_t_40 < 0)) __pyx_t_14 = 1;
21239 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_14 = 1;
21240 if (__pyx_t_41 < 0) {
21241 __pyx_t_41 += __pyx_pybuffernd_v.diminfo[2].shape;
21242 if (unlikely(__pyx_t_41 < 0)) __pyx_t_14 = 2;
21243 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_14 = 2;
21244 if (__pyx_t_42 < 0) {
21245 __pyx_t_42 += __pyx_pybuffernd_v.diminfo[3].shape;
21246 if (unlikely(__pyx_t_42 < 0)) __pyx_t_14 = 3;
21247 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_14 = 3;
21248 if (unlikely(__pyx_t_14 != -1)) {
21249 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21250 __PYX_ERR(0, 935, __pyx_L1_error)
21252 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_41, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_42, __pyx_pybuffernd_v.diminfo[3].strides) = ((((-cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t))) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_29, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_30, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_34, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_37, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_38, __pyx_pybuffernd_x.diminfo[3].strides)))));
21266 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21269 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
21270 __Pyx_PyThreadState_declare
21271 __Pyx_PyThreadState_assign
21272 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
21273 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
21274 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
21275 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
21276 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
21280 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
21281 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
21283 __Pyx_XGIVEREF(__pyx_r);
21284 __Pyx_RefNannyFinishContext();
21297 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
21298 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
21300 __Pyx_RefNannyDeclarations
21301 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
21302 __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
21305 __Pyx_RefNannyFinishContext();
21309 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
21312 int __pyx_v_endian_detector;
21313 int __pyx_v_little_endian;
21316 PyArray_Descr *__pyx_v_descr = 0;
21317 int __pyx_v_offset;
21319 __Pyx_RefNannyDeclarations
21322 PyObject *__pyx_t_3 = NULL;
21326 PyArray_Descr *__pyx_t_7;
21327 PyObject *__pyx_t_8 = NULL;
21329 if (__pyx_v_info == NULL) {
21330 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
21333 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
21334 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
21335 __Pyx_GIVEREF(__pyx_v_info->obj);
21344 __pyx_v_endian_detector = 1;
21353 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
21362 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
21371 __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
21374 __pyx_t_1 = __pyx_t_2;
21375 goto __pyx_L4_bool_binop_done;
21385 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
21386 __pyx_t_1 = __pyx_t_2;
21387 __pyx_L4_bool_binop_done:;
21396 if (unlikely(__pyx_t_1)) {
21405 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 272, __pyx_L1_error)
21406 __Pyx_GOTREF(__pyx_t_3);
21407 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21408 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21409 __PYX_ERR(1, 272, __pyx_L1_error)
21427 __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
21430 __pyx_t_1 = __pyx_t_2;
21431 goto __pyx_L7_bool_binop_done;
21441 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
21442 __pyx_t_1 = __pyx_t_2;
21443 __pyx_L7_bool_binop_done:;
21452 if (unlikely(__pyx_t_1)) {
21461 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 276, __pyx_L1_error)
21462 __Pyx_GOTREF(__pyx_t_3);
21463 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21464 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21465 __PYX_ERR(1, 276, __pyx_L1_error)
21483 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
21492 __pyx_v_info->ndim = __pyx_v_ndim;
21501 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
21511 __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
21520 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
21529 __pyx_t_4 = __pyx_v_ndim;
21530 __pyx_t_5 = __pyx_t_4;
21531 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
21532 __pyx_v_i = __pyx_t_6;
21541 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
21550 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
21571 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
21580 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
21591 __pyx_v_info->suboffsets = NULL;
21600 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
21609 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
21627 __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
21628 __pyx_t_3 = ((PyObject *)__pyx_t_7);
21629 __Pyx_INCREF(__pyx_t_3);
21630 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
21640 __Pyx_INCREF(((PyObject *)__pyx_v_self));
21641 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
21642 __Pyx_GOTREF(__pyx_v_info->obj);
21643 __Pyx_DECREF(__pyx_v_info->obj);
21644 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
21653 __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
21663 __pyx_t_4 = __pyx_v_descr->type_num;
21664 __pyx_v_t = __pyx_t_4;
21673 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'>') != 0);
21675 goto __pyx_L15_next_or;
21678 __pyx_t_2 = (__pyx_v_little_endian != 0);
21681 __pyx_t_1 = __pyx_t_2;
21682 goto __pyx_L14_bool_binop_done;
21684 __pyx_L15_next_or:;
21693 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'<') != 0);
21696 __pyx_t_1 = __pyx_t_2;
21697 goto __pyx_L14_bool_binop_done;
21699 __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
21700 __pyx_t_1 = __pyx_t_2;
21701 __pyx_L14_bool_binop_done:;
21710 if (unlikely(__pyx_t_1)) {
21719 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 306, __pyx_L1_error)
21720 __Pyx_GOTREF(__pyx_t_3);
21721 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21722 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21723 __PYX_ERR(1, 306, __pyx_L1_error)
21741 switch (__pyx_v_t) {
21743 __pyx_v_f = ((
char *)
"b");
21754 __pyx_v_f = ((
char *)
"B");
21765 __pyx_v_f = ((
char *)
"h");
21776 __pyx_v_f = ((
char *)
"H");
21787 __pyx_v_f = ((
char *)
"i");
21798 __pyx_v_f = ((
char *)
"I");
21809 __pyx_v_f = ((
char *)
"l");
21820 __pyx_v_f = ((
char *)
"L");
21831 __pyx_v_f = ((
char *)
"q");
21833 case NPY_ULONGLONG:
21842 __pyx_v_f = ((
char *)
"Q");
21853 __pyx_v_f = ((
char *)
"f");
21864 __pyx_v_f = ((
char *)
"d");
21866 case NPY_LONGDOUBLE:
21875 __pyx_v_f = ((
char *)
"g");
21886 __pyx_v_f = ((
char *)
"Zf");
21897 __pyx_v_f = ((
char *)
"Zd");
21899 case NPY_CLONGDOUBLE:
21908 __pyx_v_f = ((
char *)
"Zg");
21919 __pyx_v_f = ((
char *)
"O");
21930 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
21931 __Pyx_GOTREF(__pyx_t_3);
21932 __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 325, __pyx_L1_error)
21933 __Pyx_GOTREF(__pyx_t_8);
21934 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21935 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
21936 __Pyx_GOTREF(__pyx_t_3);
21937 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21938 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21939 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21940 __PYX_ERR(1, 325, __pyx_L1_error)
21951 __pyx_v_info->format = __pyx_v_f;
21980 __pyx_v_info->format = ((
char *)PyObject_Malloc(0xFF));
21989 (__pyx_v_info->format[0]) =
'^';
21998 __pyx_v_offset = 0;
22007 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset));
if (unlikely(__pyx_t_9 == ((
char *)NULL))) __PYX_ERR(1, 332, __pyx_L1_error)
22008 __pyx_v_f = __pyx_t_9;
22017 (__pyx_v_f[0]) =
'\x00';
22032 __Pyx_XDECREF(__pyx_t_3);
22033 __Pyx_XDECREF(__pyx_t_8);
22034 __Pyx_AddTraceback(
"numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22036 if (__pyx_v_info->obj != NULL) {
22037 __Pyx_GOTREF(__pyx_v_info->obj);
22038 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
22042 if (__pyx_v_info->obj == Py_None) {
22043 __Pyx_GOTREF(__pyx_v_info->obj);
22044 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
22047 __Pyx_XDECREF((PyObject *)__pyx_v_descr);
22048 __Pyx_RefNannyFinishContext();
22061 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info);
22062 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
22063 __Pyx_RefNannyDeclarations
22064 __Pyx_RefNannySetupContext(
"__releasebuffer__ (wrapper)", 0);
22065 __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
22068 __Pyx_RefNannyFinishContext();
22071 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
22072 __Pyx_RefNannyDeclarations
22074 __Pyx_RefNannySetupContext(
"__releasebuffer__", 0);
22083 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
22093 PyObject_Free(__pyx_v_info->format);
22111 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
22121 PyObject_Free(__pyx_v_info->strides);
22141 __Pyx_RefNannyFinishContext();
22152 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
22153 PyObject *__pyx_r = NULL;
22154 __Pyx_RefNannyDeclarations
22155 PyObject *__pyx_t_1 = NULL;
22156 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
22165 __Pyx_XDECREF(__pyx_r);
22166 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 822, __pyx_L1_error)
22167 __Pyx_GOTREF(__pyx_t_1);
22168 __pyx_r = __pyx_t_1;
22182 __Pyx_XDECREF(__pyx_t_1);
22183 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
22186 __Pyx_XGIVEREF(__pyx_r);
22187 __Pyx_RefNannyFinishContext();
22199 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
22200 PyObject *__pyx_r = NULL;
22201 __Pyx_RefNannyDeclarations
22202 PyObject *__pyx_t_1 = NULL;
22203 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
22212 __Pyx_XDECREF(__pyx_r);
22213 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 825, __pyx_L1_error)
22214 __Pyx_GOTREF(__pyx_t_1);
22215 __pyx_r = __pyx_t_1;
22229 __Pyx_XDECREF(__pyx_t_1);
22230 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
22233 __Pyx_XGIVEREF(__pyx_r);
22234 __Pyx_RefNannyFinishContext();
22246 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
22247 PyObject *__pyx_r = NULL;
22248 __Pyx_RefNannyDeclarations
22249 PyObject *__pyx_t_1 = NULL;
22250 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
22259 __Pyx_XDECREF(__pyx_r);
22260 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 828, __pyx_L1_error)
22261 __Pyx_GOTREF(__pyx_t_1);
22262 __pyx_r = __pyx_t_1;
22276 __Pyx_XDECREF(__pyx_t_1);
22277 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
22280 __Pyx_XGIVEREF(__pyx_r);
22281 __Pyx_RefNannyFinishContext();
22293 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
22294 PyObject *__pyx_r = NULL;
22295 __Pyx_RefNannyDeclarations
22296 PyObject *__pyx_t_1 = NULL;
22297 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
22306 __Pyx_XDECREF(__pyx_r);
22307 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 831, __pyx_L1_error)
22308 __Pyx_GOTREF(__pyx_t_1);
22309 __pyx_r = __pyx_t_1;
22323 __Pyx_XDECREF(__pyx_t_1);
22324 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
22327 __Pyx_XGIVEREF(__pyx_r);
22328 __Pyx_RefNannyFinishContext();
22340 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
22341 PyObject *__pyx_r = NULL;
22342 __Pyx_RefNannyDeclarations
22343 PyObject *__pyx_t_1 = NULL;
22344 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
22353 __Pyx_XDECREF(__pyx_r);
22354 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 834, __pyx_L1_error)
22355 __Pyx_GOTREF(__pyx_t_1);
22356 __pyx_r = __pyx_t_1;
22370 __Pyx_XDECREF(__pyx_t_1);
22371 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
22374 __Pyx_XGIVEREF(__pyx_r);
22375 __Pyx_RefNannyFinishContext();
22387 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
22388 PyObject *__pyx_r = NULL;
22389 __Pyx_RefNannyDeclarations
22391 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
22400 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
22410 __Pyx_XDECREF(__pyx_r);
22411 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
22412 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
22432 __Pyx_XDECREF(__pyx_r);
22433 __Pyx_INCREF(__pyx_empty_tuple);
22434 __pyx_r = __pyx_empty_tuple;
22448 __Pyx_XGIVEREF(__pyx_r);
22449 __Pyx_RefNannyFinishContext();
22461 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr,
char *__pyx_v_f,
char *__pyx_v_end,
int *__pyx_v_offset) {
22462 PyArray_Descr *__pyx_v_child = 0;
22463 int __pyx_v_endian_detector;
22464 int __pyx_v_little_endian;
22465 PyObject *__pyx_v_fields = 0;
22466 PyObject *__pyx_v_childname = NULL;
22467 PyObject *__pyx_v_new_offset = NULL;
22468 PyObject *__pyx_v_t = NULL;
22470 __Pyx_RefNannyDeclarations
22471 PyObject *__pyx_t_1 = NULL;
22472 Py_ssize_t __pyx_t_2;
22473 PyObject *__pyx_t_3 = NULL;
22474 PyObject *__pyx_t_4 = NULL;
22480 __Pyx_RefNannySetupContext(
"_util_dtypestring", 0);
22489 __pyx_v_endian_detector = 1;
22498 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
22507 if (unlikely(__pyx_v_descr->names == Py_None)) {
22508 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
22509 __PYX_ERR(1, 851, __pyx_L1_error)
22511 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
22513 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
22514 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 22515 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
if (unlikely(0 < 0)) __PYX_ERR(1, 851, __pyx_L1_error)
22517 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 851, __pyx_L1_error)
22518 __Pyx_GOTREF(__pyx_t_3);
22520 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
22530 if (unlikely(__pyx_v_descr->fields == Py_None)) {
22531 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
22532 __PYX_ERR(1, 852, __pyx_L1_error)
22534 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 852, __pyx_L1_error)
22535 __Pyx_GOTREF(__pyx_t_3);
22536 if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 852, __pyx_L1_error)
22537 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
22547 if (likely(__pyx_v_fields != Py_None)) {
22548 PyObject* sequence = __pyx_v_fields;
22549 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
22550 if (unlikely(size != 2)) {
22551 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
22552 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
22553 __PYX_ERR(1, 853, __pyx_L1_error)
22555 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 22556 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
22557 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
22558 __Pyx_INCREF(__pyx_t_3);
22559 __Pyx_INCREF(__pyx_t_4);
22561 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 853, __pyx_L1_error)
22562 __Pyx_GOTREF(__pyx_t_3);
22563 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 853, __pyx_L1_error)
22564 __Pyx_GOTREF(__pyx_t_4);
22567 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 853, __pyx_L1_error)
22569 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 853, __pyx_L1_error)
22570 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
22572 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
22582 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 855, __pyx_L1_error)
22583 __Pyx_GOTREF(__pyx_t_4);
22584 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 855, __pyx_L1_error)
22585 __Pyx_GOTREF(__pyx_t_3);
22586 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22587 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 855, __pyx_L1_error)
22588 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22589 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((
int)__pyx_t_5)) < 15) != 0);
22590 if (unlikely(__pyx_t_6)) {
22599 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 856, __pyx_L1_error)
22600 __Pyx_GOTREF(__pyx_t_3);
22601 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
22602 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22603 __PYX_ERR(1, 856, __pyx_L1_error)
22621 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'>') != 0);
22623 goto __pyx_L8_next_or;
22626 __pyx_t_7 = (__pyx_v_little_endian != 0);
22629 __pyx_t_6 = __pyx_t_7;
22630 goto __pyx_L7_bool_binop_done;
22641 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'<') != 0);
22644 __pyx_t_6 = __pyx_t_7;
22645 goto __pyx_L7_bool_binop_done;
22647 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
22648 __pyx_t_6 = __pyx_t_7;
22649 __pyx_L7_bool_binop_done:;
22658 if (unlikely(__pyx_t_6)) {
22667 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 860, __pyx_L1_error)
22668 __Pyx_GOTREF(__pyx_t_3);
22669 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
22670 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22671 __PYX_ERR(1, 860, __pyx_L1_error)
22690 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 870, __pyx_L1_error)
22691 __Pyx_GOTREF(__pyx_t_3);
22692 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 870, __pyx_L1_error)
22693 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22694 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 870, __pyx_L1_error)
22695 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22696 if (!__pyx_t_6)
break;
22705 (__pyx_v_f[0]) = 0x78;
22714 __pyx_v_f = (__pyx_v_f + 1);
22724 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
22735 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
22744 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
22754 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 878, __pyx_L1_error)
22755 __Pyx_GOTREF(__pyx_t_4);
22756 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
22766 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
22767 if (unlikely(__pyx_t_6)) {
22776 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 880, __pyx_L1_error)
22777 __Pyx_GOTREF(__pyx_t_4);
22778 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
22779 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22780 __PYX_ERR(1, 880, __pyx_L1_error)
22798 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 883, __pyx_L1_error)
22799 __Pyx_GOTREF(__pyx_t_4);
22800 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 883, __pyx_L1_error)
22801 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22802 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 883, __pyx_L1_error)
22803 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22805 (__pyx_v_f[0]) = 98;
22816 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 884, __pyx_L1_error)
22817 __Pyx_GOTREF(__pyx_t_3);
22818 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 884, __pyx_L1_error)
22819 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22820 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 884, __pyx_L1_error)
22821 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22823 (__pyx_v_f[0]) = 66;
22834 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 885, __pyx_L1_error)
22835 __Pyx_GOTREF(__pyx_t_4);
22836 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 885, __pyx_L1_error)
22837 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22838 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 885, __pyx_L1_error)
22839 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22841 (__pyx_v_f[0]) = 0x68;
22852 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 886, __pyx_L1_error)
22853 __Pyx_GOTREF(__pyx_t_3);
22854 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 886, __pyx_L1_error)
22855 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22856 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 886, __pyx_L1_error)
22857 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22859 (__pyx_v_f[0]) = 72;
22870 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 887, __pyx_L1_error)
22871 __Pyx_GOTREF(__pyx_t_4);
22872 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 887, __pyx_L1_error)
22873 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22874 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 887, __pyx_L1_error)
22875 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22877 (__pyx_v_f[0]) = 0x69;
22888 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 888, __pyx_L1_error)
22889 __Pyx_GOTREF(__pyx_t_3);
22890 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 888, __pyx_L1_error)
22891 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22892 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 888, __pyx_L1_error)
22893 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22895 (__pyx_v_f[0]) = 73;
22906 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 889, __pyx_L1_error)
22907 __Pyx_GOTREF(__pyx_t_4);
22908 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 889, __pyx_L1_error)
22909 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22910 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 889, __pyx_L1_error)
22911 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22913 (__pyx_v_f[0]) = 0x6C;
22924 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 890, __pyx_L1_error)
22925 __Pyx_GOTREF(__pyx_t_3);
22926 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 890, __pyx_L1_error)
22927 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22928 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 890, __pyx_L1_error)
22929 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22931 (__pyx_v_f[0]) = 76;
22942 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 891, __pyx_L1_error)
22943 __Pyx_GOTREF(__pyx_t_4);
22944 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 891, __pyx_L1_error)
22945 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22946 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 891, __pyx_L1_error)
22947 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22949 (__pyx_v_f[0]) = 0x71;
22960 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 892, __pyx_L1_error)
22961 __Pyx_GOTREF(__pyx_t_3);
22962 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 892, __pyx_L1_error)
22963 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22964 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 892, __pyx_L1_error)
22965 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22967 (__pyx_v_f[0]) = 81;
22978 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 893, __pyx_L1_error)
22979 __Pyx_GOTREF(__pyx_t_4);
22980 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 893, __pyx_L1_error)
22981 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22982 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 893, __pyx_L1_error)
22983 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22985 (__pyx_v_f[0]) = 0x66;
22996 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 894, __pyx_L1_error)
22997 __Pyx_GOTREF(__pyx_t_3);
22998 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 894, __pyx_L1_error)
22999 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23000 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 894, __pyx_L1_error)
23001 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23003 (__pyx_v_f[0]) = 0x64;
23014 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 895, __pyx_L1_error)
23015 __Pyx_GOTREF(__pyx_t_4);
23016 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 895, __pyx_L1_error)
23017 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23018 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 895, __pyx_L1_error)
23019 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23021 (__pyx_v_f[0]) = 0x67;
23032 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 896, __pyx_L1_error)
23033 __Pyx_GOTREF(__pyx_t_3);
23034 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 896, __pyx_L1_error)
23035 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23036 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 896, __pyx_L1_error)
23037 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23039 (__pyx_v_f[0]) = 90;
23040 (__pyx_v_f[1]) = 0x66;
23041 __pyx_v_f = (__pyx_v_f + 1);
23052 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 897, __pyx_L1_error)
23053 __Pyx_GOTREF(__pyx_t_4);
23054 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 897, __pyx_L1_error)
23055 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23056 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 897, __pyx_L1_error)
23057 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23059 (__pyx_v_f[0]) = 90;
23060 (__pyx_v_f[1]) = 0x64;
23061 __pyx_v_f = (__pyx_v_f + 1);
23072 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 898, __pyx_L1_error)
23073 __Pyx_GOTREF(__pyx_t_3);
23074 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 898, __pyx_L1_error)
23075 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23076 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 898, __pyx_L1_error)
23077 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23079 (__pyx_v_f[0]) = 90;
23080 (__pyx_v_f[1]) = 0x67;
23081 __pyx_v_f = (__pyx_v_f + 1);
23092 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 899, __pyx_L1_error)
23093 __Pyx_GOTREF(__pyx_t_4);
23094 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 899, __pyx_L1_error)
23095 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23096 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 899, __pyx_L1_error)
23097 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23098 if (likely(__pyx_t_6)) {
23099 (__pyx_v_f[0]) = 79;
23111 __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 901, __pyx_L1_error)
23112 __Pyx_GOTREF(__pyx_t_3);
23113 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 901, __pyx_L1_error)
23114 __Pyx_GOTREF(__pyx_t_4);
23115 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23116 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
23117 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23118 __PYX_ERR(1, 901, __pyx_L1_error)
23129 __pyx_v_f = (__pyx_v_f + 1);
23149 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset);
if (unlikely(__pyx_t_9 == ((
char *)NULL))) __PYX_ERR(1, 906, __pyx_L1_error)
23150 __pyx_v_f = __pyx_t_9;
23162 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23171 __pyx_r = __pyx_v_f;
23184 __Pyx_XDECREF(__pyx_t_1);
23185 __Pyx_XDECREF(__pyx_t_3);
23186 __Pyx_XDECREF(__pyx_t_4);
23187 __Pyx_AddTraceback(
"numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
23190 __Pyx_XDECREF((PyObject *)__pyx_v_child);
23191 __Pyx_XDECREF(__pyx_v_fields);
23192 __Pyx_XDECREF(__pyx_v_childname);
23193 __Pyx_XDECREF(__pyx_v_new_offset);
23194 __Pyx_XDECREF(__pyx_v_t);
23195 __Pyx_RefNannyFinishContext();
23207 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
23208 __Pyx_RefNannyDeclarations
23209 __Pyx_RefNannySetupContext(
"set_array_base", 0);
23218 Py_INCREF(__pyx_v_base);
23227 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
23238 __Pyx_RefNannyFinishContext();
23249 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
23250 PyObject *__pyx_v_base;
23251 PyObject *__pyx_r = NULL;
23252 __Pyx_RefNannyDeclarations
23254 __Pyx_RefNannySetupContext(
"get_array_base", 0);
23263 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
23272 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
23282 __Pyx_XDECREF(__pyx_r);
23283 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23302 __Pyx_XDECREF(__pyx_r);
23303 __Pyx_INCREF(((PyObject *)__pyx_v_base));
23304 __pyx_r = ((PyObject *)__pyx_v_base);
23317 __Pyx_XGIVEREF(__pyx_r);
23318 __Pyx_RefNannyFinishContext();
23330 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
23332 __Pyx_RefNannyDeclarations
23333 PyObject *__pyx_t_1 = NULL;
23334 PyObject *__pyx_t_2 = NULL;
23335 PyObject *__pyx_t_3 = NULL;
23337 PyObject *__pyx_t_5 = NULL;
23338 PyObject *__pyx_t_6 = NULL;
23339 PyObject *__pyx_t_7 = NULL;
23340 PyObject *__pyx_t_8 = NULL;
23341 __Pyx_RefNannySetupContext(
"import_array", 0);
23351 __Pyx_PyThreadState_declare
23352 __Pyx_PyThreadState_assign
23353 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
23354 __Pyx_XGOTREF(__pyx_t_1);
23355 __Pyx_XGOTREF(__pyx_t_2);
23356 __Pyx_XGOTREF(__pyx_t_3);
23366 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1036, __pyx_L3_error)
23376 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
23377 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23378 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
23379 goto __pyx_L8_try_end;
23389 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
23391 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
23392 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1037, __pyx_L5_except_error)
23393 __Pyx_GOTREF(__pyx_t_5);
23394 __Pyx_GOTREF(__pyx_t_6);
23395 __Pyx_GOTREF(__pyx_t_7);
23404 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1038, __pyx_L5_except_error)
23405 __Pyx_GOTREF(__pyx_t_8);
23406 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
23407 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23408 __PYX_ERR(1, 1038, __pyx_L5_except_error)
23410 goto __pyx_L5_except_error;
23411 __pyx_L5_except_error:;
23420 __Pyx_XGIVEREF(__pyx_t_1);
23421 __Pyx_XGIVEREF(__pyx_t_2);
23422 __Pyx_XGIVEREF(__pyx_t_3);
23423 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
23424 goto __pyx_L1_error;
23440 __Pyx_XDECREF(__pyx_t_5);
23441 __Pyx_XDECREF(__pyx_t_6);
23442 __Pyx_XDECREF(__pyx_t_7);
23443 __Pyx_XDECREF(__pyx_t_8);
23444 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
23447 __Pyx_RefNannyFinishContext();
23459 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
23461 __Pyx_RefNannyDeclarations
23462 PyObject *__pyx_t_1 = NULL;
23463 PyObject *__pyx_t_2 = NULL;
23464 PyObject *__pyx_t_3 = NULL;
23466 PyObject *__pyx_t_5 = NULL;
23467 PyObject *__pyx_t_6 = NULL;
23468 PyObject *__pyx_t_7 = NULL;
23469 PyObject *__pyx_t_8 = NULL;
23470 __Pyx_RefNannySetupContext(
"import_umath", 0);
23480 __Pyx_PyThreadState_declare
23481 __Pyx_PyThreadState_assign
23482 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
23483 __Pyx_XGOTREF(__pyx_t_1);
23484 __Pyx_XGOTREF(__pyx_t_2);
23485 __Pyx_XGOTREF(__pyx_t_3);
23495 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1042, __pyx_L3_error)
23505 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
23506 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23507 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
23508 goto __pyx_L8_try_end;
23518 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
23520 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
23521 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1043, __pyx_L5_except_error)
23522 __Pyx_GOTREF(__pyx_t_5);
23523 __Pyx_GOTREF(__pyx_t_6);
23524 __Pyx_GOTREF(__pyx_t_7);
23533 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1044, __pyx_L5_except_error)
23534 __Pyx_GOTREF(__pyx_t_8);
23535 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
23536 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23537 __PYX_ERR(1, 1044, __pyx_L5_except_error)
23539 goto __pyx_L5_except_error;
23540 __pyx_L5_except_error:;
23549 __Pyx_XGIVEREF(__pyx_t_1);
23550 __Pyx_XGIVEREF(__pyx_t_2);
23551 __Pyx_XGIVEREF(__pyx_t_3);
23552 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
23553 goto __pyx_L1_error;
23569 __Pyx_XDECREF(__pyx_t_5);
23570 __Pyx_XDECREF(__pyx_t_6);
23571 __Pyx_XDECREF(__pyx_t_7);
23572 __Pyx_XDECREF(__pyx_t_8);
23573 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
23576 __Pyx_RefNannyFinishContext();
23588 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
23590 __Pyx_RefNannyDeclarations
23591 PyObject *__pyx_t_1 = NULL;
23592 PyObject *__pyx_t_2 = NULL;
23593 PyObject *__pyx_t_3 = NULL;
23595 PyObject *__pyx_t_5 = NULL;
23596 PyObject *__pyx_t_6 = NULL;
23597 PyObject *__pyx_t_7 = NULL;
23598 PyObject *__pyx_t_8 = NULL;
23599 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
23609 __Pyx_PyThreadState_declare
23610 __Pyx_PyThreadState_assign
23611 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
23612 __Pyx_XGOTREF(__pyx_t_1);
23613 __Pyx_XGOTREF(__pyx_t_2);
23614 __Pyx_XGOTREF(__pyx_t_3);
23624 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1048, __pyx_L3_error)
23634 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
23635 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23636 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
23637 goto __pyx_L8_try_end;
23646 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
23648 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
23649 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1049, __pyx_L5_except_error)
23650 __Pyx_GOTREF(__pyx_t_5);
23651 __Pyx_GOTREF(__pyx_t_6);
23652 __Pyx_GOTREF(__pyx_t_7);
23659 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1050, __pyx_L5_except_error)
23660 __Pyx_GOTREF(__pyx_t_8);
23661 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
23662 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23663 __PYX_ERR(1, 1050, __pyx_L5_except_error)
23665 goto __pyx_L5_except_error;
23666 __pyx_L5_except_error:;
23675 __Pyx_XGIVEREF(__pyx_t_1);
23676 __Pyx_XGIVEREF(__pyx_t_2);
23677 __Pyx_XGIVEREF(__pyx_t_3);
23678 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
23679 goto __pyx_L1_error;
23695 __Pyx_XDECREF(__pyx_t_5);
23696 __Pyx_XDECREF(__pyx_t_6);
23697 __Pyx_XDECREF(__pyx_t_7);
23698 __Pyx_XDECREF(__pyx_t_8);
23699 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
23702 __Pyx_RefNannyFinishContext();
23706 static PyMethodDef __pyx_methods[] = {
23710 #if PY_MAJOR_VERSION >= 3 23711 #if CYTHON_PEP489_MULTI_PHASE_INIT 23712 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
23713 static int __pyx_pymod_exec_subsurfaceTransportFunctions(PyObject* module);
23714 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
23715 {Py_mod_create, (
void*)__pyx_pymod_create},
23716 {Py_mod_exec, (
void*)__pyx_pymod_exec_subsurfaceTransportFunctions},
23721 static struct PyModuleDef __pyx_moduledef = {
23722 PyModuleDef_HEAD_INIT,
23723 "subsurfaceTransportFunctions",
23725 #if CYTHON_PEP489_MULTI_PHASE_INIT 23731 #if CYTHON_PEP489_MULTI_PHASE_INIT 23732 __pyx_moduledef_slots,
23741 #ifndef CYTHON_SMALL_CODE 23742 #if defined(__clang__) 23743 #define CYTHON_SMALL_CODE 23744 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) 23745 #define CYTHON_SMALL_CODE __attribute__((cold)) 23747 #define CYTHON_SMALL_CODE 23751 static __Pyx_StringTabEntry __pyx_string_tab[] = {
23752 {&__pyx_n_s_DKWr_DpsiC, __pyx_k_DKWr_DpsiC,
sizeof(__pyx_k_DKWr_DpsiC), 0, 0, 1, 1},
23753 {&__pyx_n_s_DsBar_DpsiC, __pyx_k_DsBar_DpsiC,
sizeof(__pyx_k_DsBar_DpsiC), 0, 0, 1, 1},
23754 {&__pyx_n_s_DthetaW_DpsiC, __pyx_k_DthetaW_DpsiC,
sizeof(__pyx_k_DthetaW_DpsiC), 0, 0, 1, 1},
23755 {&__pyx_n_s_DvBar_DpsiC, __pyx_k_DvBar_DpsiC,
sizeof(__pyx_k_DvBar_DpsiC), 0, 0, 1, 1},
23756 {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor,
sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
23757 {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2,
sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
23758 {&__pyx_n_s_I, __pyx_k_I,
sizeof(__pyx_k_I), 0, 0, 1, 1},
23759 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
23760 {&__pyx_n_s_J, __pyx_k_J,
sizeof(__pyx_k_J), 0, 0, 1, 1},
23761 {&__pyx_n_s_KWr, __pyx_k_KWr,
sizeof(__pyx_k_KWr), 0, 0, 1, 1},
23762 {&__pyx_n_s_KWs, __pyx_k_KWs,
sizeof(__pyx_k_KWs), 0, 0, 1, 1},
23763 {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor,
sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
23764 {&__pyx_n_s_RE_NCP1_evaluateElementCoefficie, __pyx_k_RE_NCP1_evaluateElementCoefficie,
sizeof(__pyx_k_RE_NCP1_evaluateElementCoefficie), 0, 0, 1, 1},
23765 {&__pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, __pyx_k_RE_NCP1_evaluateElementCoefficie_2,
sizeof(__pyx_k_RE_NCP1_evaluateElementCoefficie_2), 0, 0, 1, 1},
23766 {&__pyx_n_s_RE_NCP1_getElementJacobian, __pyx_k_RE_NCP1_getElementJacobian,
sizeof(__pyx_k_RE_NCP1_getElementJacobian), 0, 0, 1, 1},
23767 {&__pyx_n_s_RE_NCP1_getElementResidual, __pyx_k_RE_NCP1_getElementResidual,
sizeof(__pyx_k_RE_NCP1_getElementResidual), 0, 0, 1, 1},
23768 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
23769 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
23770 {&__pyx_n_s_a_avg, __pyx_k_a_avg,
sizeof(__pyx_k_a_avg), 0, 0, 1, 1},
23771 {&__pyx_n_s_a_eN, __pyx_k_a_eN,
sizeof(__pyx_k_a_eN), 0, 0, 1, 1},
23772 {&__pyx_n_s_a_neig, __pyx_k_a_neig,
sizeof(__pyx_k_a_neig), 0, 0, 1, 1},
23773 {&__pyx_n_s_a_up, __pyx_k_a_up,
sizeof(__pyx_k_a_up), 0, 0, 1, 1},
23774 {&__pyx_n_s_alpha, __pyx_k_alpha,
sizeof(__pyx_k_alpha), 0, 0, 1, 1},
23775 {&__pyx_n_s_beta, __pyx_k_beta,
sizeof(__pyx_k_beta), 0, 0, 1, 1},
23776 {&__pyx_n_s_calculateNormalFlux, __pyx_k_calculateNormalFlux,
sizeof(__pyx_k_calculateNormalFlux), 0, 0, 1, 1},
23777 {&__pyx_n_s_characteristic_velocity, __pyx_k_characteristic_velocity,
sizeof(__pyx_k_characteristic_velocity), 0, 0, 1, 1},
23778 {&__pyx_n_s_characteristic_velocity_dofs, __pyx_k_characteristic_velocity_dofs,
sizeof(__pyx_k_characteristic_velocity_dofs), 0, 0, 1, 1},
23779 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
23780 {&__pyx_n_s_clock, __pyx_k_clock,
sizeof(__pyx_k_clock), 0, 0, 1, 1},
23781 {&__pyx_n_s_colind, __pyx_k_colind,
sizeof(__pyx_k_colind), 0, 0, 1, 1},
23782 {&__pyx_n_s_computeSimpleCharacteristicVeloc, __pyx_k_computeSimpleCharacteristicVeloc,
sizeof(__pyx_k_computeSimpleCharacteristicVeloc), 0, 0, 1, 1},
23783 {&__pyx_n_s_computeSimpleCharacteristicVeloc_2, __pyx_k_computeSimpleCharacteristicVeloc_2,
sizeof(__pyx_k_computeSimpleCharacteristicVeloc_2), 0, 0, 1, 1},
23784 {&__pyx_n_s_d, __pyx_k_d,
sizeof(__pyx_k_d), 0, 0, 1, 1},
23785 {&__pyx_n_s_dS, __pyx_k_dS,
sizeof(__pyx_k_dS), 0, 0, 1, 1},
23786 {&__pyx_n_s_dV, __pyx_k_dV,
sizeof(__pyx_k_dV), 0, 0, 1, 1},
23787 {&__pyx_n_s_denom, __pyx_k_denom,
sizeof(__pyx_k_denom), 0, 0, 1, 1},
23788 {&__pyx_n_s_df, __pyx_k_df,
sizeof(__pyx_k_df), 0, 0, 1, 1},
23789 {&__pyx_n_s_df_dofs, __pyx_k_df_dofs,
sizeof(__pyx_k_df_dofs), 0, 0, 1, 1},
23790 {&__pyx_n_s_dkr_up, __pyx_k_dkr_up,
sizeof(__pyx_k_dkr_up), 0, 0, 1, 1},
23791 {&__pyx_n_s_dm, __pyx_k_dm,
sizeof(__pyx_k_dm), 0, 0, 1, 1},
23792 {&__pyx_n_s_dmt, __pyx_k_dmt,
sizeof(__pyx_k_dmt), 0, 0, 1, 1},
23793 {&__pyx_n_s_dmtj_avg, __pyx_k_dmtj_avg,
sizeof(__pyx_k_dmtj_avg), 0, 0, 1, 1},
23794 {&__pyx_n_s_dot, __pyx_k_dot,
sizeof(__pyx_k_dot), 0, 0, 1, 1},
23795 {&__pyx_n_s_drhom, __pyx_k_drhom,
sizeof(__pyx_k_drhom), 0, 0, 1, 1},
23796 {&__pyx_n_s_eN, __pyx_k_eN,
sizeof(__pyx_k_eN), 0, 0, 1, 1},
23797 {&__pyx_n_s_eN_left, __pyx_k_eN_left,
sizeof(__pyx_k_eN_left), 0, 0, 1, 1},
23798 {&__pyx_n_s_eN_neighbor, __pyx_k_eN_neighbor,
sizeof(__pyx_k_eN_neighbor), 0, 0, 1, 1},
23799 {&__pyx_n_s_eN_right, __pyx_k_eN_right,
sizeof(__pyx_k_eN_right), 0, 0, 1, 1},
23800 {&__pyx_n_s_ebN, __pyx_k_ebN,
sizeof(__pyx_k_ebN), 0, 0, 1, 1},
23801 {&__pyx_n_s_ebNE, __pyx_k_ebNE,
sizeof(__pyx_k_ebNE), 0, 0, 1, 1},
23802 {&__pyx_n_s_ebN_local, __pyx_k_ebN_local,
sizeof(__pyx_k_ebN_local), 0, 0, 1, 1},
23803 {&__pyx_n_s_ebq_global_vals, __pyx_k_ebq_global_vals,
sizeof(__pyx_k_ebq_global_vals), 0, 0, 1, 1},
23804 {&__pyx_n_s_ebq_vals, __pyx_k_ebq_vals,
sizeof(__pyx_k_ebq_vals), 0, 0, 1, 1},
23805 {&__pyx_n_s_elementBarycentersArray, __pyx_k_elementBarycentersArray,
sizeof(__pyx_k_elementBarycentersArray), 0, 0, 1, 1},
23806 {&__pyx_n_s_elementBoundariesArray, __pyx_k_elementBoundariesArray,
sizeof(__pyx_k_elementBoundariesArray), 0, 0, 1, 1},
23807 {&__pyx_n_s_elementBoundaryElementsArray, __pyx_k_elementBoundaryElementsArray,
sizeof(__pyx_k_elementBoundaryElementsArray), 0, 0, 1, 1},
23808 {&__pyx_n_s_elementBoundaryMaterialTypes, __pyx_k_elementBoundaryMaterialTypes,
sizeof(__pyx_k_elementBoundaryMaterialTypes), 0, 0, 1, 1},
23809 {&__pyx_n_s_elementBoundaryTypes, __pyx_k_elementBoundaryTypes,
sizeof(__pyx_k_elementBoundaryTypes), 0, 0, 1, 1},
23810 {&__pyx_n_s_elementJacobian, __pyx_k_elementJacobian,
sizeof(__pyx_k_elementJacobian), 0, 0, 1, 1},
23811 {&__pyx_n_s_elementMaterialTypes, __pyx_k_elementMaterialTypes,
sizeof(__pyx_k_elementMaterialTypes), 0, 0, 1, 1},
23812 {&__pyx_n_s_elementNeighborsArray, __pyx_k_elementNeighborsArray,
sizeof(__pyx_k_elementNeighborsArray), 0, 0, 1, 1},
23813 {&__pyx_n_s_elementResidual, __pyx_k_elementResidual,
sizeof(__pyx_k_elementResidual), 0, 0, 1, 1},
23814 {&__pyx_n_s_evaluateScalarMaterialFunctionOv, __pyx_k_evaluateScalarMaterialFunctionOv,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv), 0, 0, 1, 1},
23815 {&__pyx_n_s_evaluateScalarMaterialFunctionOv_2, __pyx_k_evaluateScalarMaterialFunctionOv_2,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv_2), 0, 0, 1, 1},
23816 {&__pyx_n_s_evaluateScalarMaterialFunctionOv_3, __pyx_k_evaluateScalarMaterialFunctionOv_3,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv_3), 0, 0, 1, 1},
23817 {&__pyx_n_s_evaluateSparseTensorMaterialFunc, __pyx_k_evaluateSparseTensorMaterialFunc,
sizeof(__pyx_k_evaluateSparseTensorMaterialFunc), 0, 0, 1, 1},
23818 {&__pyx_n_s_evaluateSparseTensorMaterialFunc_2, __pyx_k_evaluateSparseTensorMaterialFunc_2,
sizeof(__pyx_k_evaluateSparseTensorMaterialFunc_2), 0, 0, 1, 1},
23819 {&__pyx_n_s_evaluateVectorMaterialFunctionOv, __pyx_k_evaluateVectorMaterialFunctionOv,
sizeof(__pyx_k_evaluateVectorMaterialFunctionOv), 0, 0, 1, 1},
23820 {&__pyx_n_s_exteriorElementBoundariesArray, __pyx_k_exteriorElementBoundariesArray,
sizeof(__pyx_k_exteriorElementBoundariesArray), 0, 0, 1, 1},
23821 {&__pyx_n_s_exteriorElementBoundaryMaterialT, __pyx_k_exteriorElementBoundaryMaterialT,
sizeof(__pyx_k_exteriorElementBoundaryMaterialT), 0, 0, 1, 1},
23822 {&__pyx_n_s_f_up, __pyx_k_f_up,
sizeof(__pyx_k_f_up), 0, 0, 1, 1},
23823 {&__pyx_n_s_flat, __pyx_k_flat,
sizeof(__pyx_k_flat), 0, 0, 1, 1},
23824 {&__pyx_n_s_flux, __pyx_k_flux,
sizeof(__pyx_k_flux), 0, 0, 1, 1},
23825 {&__pyx_n_s_gravity, __pyx_k_gravity,
sizeof(__pyx_k_gravity), 0, 0, 1, 1},
23826 {&__pyx_n_s_helicalElementVelocityEval3, __pyx_k_helicalElementVelocityEval3,
sizeof(__pyx_k_helicalElementVelocityEval3), 0, 0, 1, 1},
23827 {&__pyx_n_s_helicalElementVelocityEval4, __pyx_k_helicalElementVelocityEval4,
sizeof(__pyx_k_helicalElementVelocityEval4), 0, 0, 1, 1},
23828 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
23829 {&__pyx_n_s_ii, __pyx_k_ii,
sizeof(__pyx_k_ii), 0, 0, 1, 1},
23830 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
23831 {&__pyx_n_s_integral, __pyx_k_integral,
sizeof(__pyx_k_integral), 0, 0, 1, 1},
23832 {&__pyx_n_s_j, __pyx_k_j,
sizeof(__pyx_k_j), 0, 0, 1, 1},
23833 {&__pyx_n_s_jacobian_weak_residual, __pyx_k_jacobian_weak_residual,
sizeof(__pyx_k_jacobian_weak_residual), 0, 0, 1, 1},
23834 {&__pyx_n_s_k, __pyx_k_k,
sizeof(__pyx_k_k), 0, 0, 1, 1},
23835 {&__pyx_n_s_kb, __pyx_k_kb,
sizeof(__pyx_k_kb), 0, 0, 1, 1},
23836 {&__pyx_n_s_kr_eN, __pyx_k_kr_eN,
sizeof(__pyx_k_kr_eN), 0, 0, 1, 1},
23837 {&__pyx_n_s_kr_neig, __pyx_k_kr_neig,
sizeof(__pyx_k_kr_neig), 0, 0, 1, 1},
23838 {&__pyx_n_s_l2g, __pyx_k_l2g,
sizeof(__pyx_k_l2g), 0, 0, 1, 1},
23839 {&__pyx_n_s_m, __pyx_k_m,
sizeof(__pyx_k_m), 0, 0, 1, 1},
23840 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
23841 {&__pyx_n_s_matID, __pyx_k_matID,
sizeof(__pyx_k_matID), 0, 0, 1, 1},
23842 {&__pyx_n_s_matID_neig, __pyx_k_matID_neig,
sizeof(__pyx_k_matID_neig), 0, 0, 1, 1},
23843 {&__pyx_n_s_material, __pyx_k_material,
sizeof(__pyx_k_material), 0, 0, 1, 1},
23844 {&__pyx_n_s_material_functions, __pyx_k_material_functions,
sizeof(__pyx_k_material_functions), 0, 0, 1, 1},
23845 {&__pyx_n_s_material_left, __pyx_k_material_left,
sizeof(__pyx_k_material_left), 0, 0, 1, 1},
23846 {&__pyx_n_s_material_right, __pyx_k_material_right,
sizeof(__pyx_k_material_right), 0, 0, 1, 1},
23847 {&__pyx_n_s_mt, __pyx_k_mt,
sizeof(__pyx_k_mt), 0, 0, 1, 1},
23848 {&__pyx_n_s_mt_avg, __pyx_k_mt_avg,
sizeof(__pyx_k_mt_avg), 0, 0, 1, 1},
23849 {&__pyx_n_s_n, __pyx_k_n,
sizeof(__pyx_k_n), 0, 0, 1, 1},
23850 {&__pyx_n_s_nAvgWeight, __pyx_k_nAvgWeight,
sizeof(__pyx_k_nAvgWeight), 0, 0, 1, 1},
23851 {&__pyx_n_s_nDOF_test_element, __pyx_k_nDOF_test_element,
sizeof(__pyx_k_nDOF_test_element), 0, 0, 1, 1},
23852 {&__pyx_n_s_nDOF_trial_element, __pyx_k_nDOF_trial_element,
sizeof(__pyx_k_nDOF_trial_element), 0, 0, 1, 1},
23853 {&__pyx_n_s_nElementBoundaries_element, __pyx_k_nElementBoundaries_element,
sizeof(__pyx_k_nElementBoundaries_element), 0, 0, 1, 1},
23854 {&__pyx_n_s_nElementBoundaries_global, __pyx_k_nElementBoundaries_global,
sizeof(__pyx_k_nElementBoundaries_global), 0, 0, 1, 1},
23855 {&__pyx_n_s_nElements_global, __pyx_k_nElements_global,
sizeof(__pyx_k_nElements_global), 0, 0, 1, 1},
23856 {&__pyx_n_s_nExteriorElementBoundaries_globa, __pyx_k_nExteriorElementBoundaries_globa,
sizeof(__pyx_k_nExteriorElementBoundaries_globa), 0, 0, 1, 1},
23857 {&__pyx_n_s_nSpace, __pyx_k_nSpace,
sizeof(__pyx_k_nSpace), 0, 0, 1, 1},
23858 {&__pyx_n_s_nSpace2, __pyx_k_nSpace2,
sizeof(__pyx_k_nSpace2), 0, 0, 1, 1},
23859 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
23860 {&__pyx_n_s_nd, __pyx_k_nd,
sizeof(__pyx_k_nd), 0, 0, 1, 1},
23861 {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous,
sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
23862 {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou,
sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
23863 {&__pyx_n_s_nnz, __pyx_k_nnz,
sizeof(__pyx_k_nnz), 0, 0, 1, 1},
23864 {&__pyx_n_s_numer, __pyx_k_numer,
sizeof(__pyx_k_numer), 0, 0, 1, 1},
23865 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
23866 {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to,
sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
23867 {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor,
sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
23868 {&__pyx_n_s_omega_e, __pyx_k_omega_e,
sizeof(__pyx_k_omega_e), 0, 0, 1, 1},
23869 {&__pyx_n_s_one8, __pyx_k_one8,
sizeof(__pyx_k_one8), 0, 0, 1, 1},
23870 {&__pyx_n_s_onePlus_pcBar_n, __pyx_k_onePlus_pcBar_n,
sizeof(__pyx_k_onePlus_pcBar_n), 0, 0, 1, 1},
23871 {&__pyx_n_s_pcBar, __pyx_k_pcBar,
sizeof(__pyx_k_pcBar), 0, 0, 1, 1},
23872 {&__pyx_n_s_pcBar_n, __pyx_k_pcBar_n,
sizeof(__pyx_k_pcBar_n), 0, 0, 1, 1},
23873 {&__pyx_n_s_pcBar_nM1, __pyx_k_pcBar_nM1,
sizeof(__pyx_k_pcBar_nM1), 0, 0, 1, 1},
23874 {&__pyx_n_s_pcBar_nM2, __pyx_k_pcBar_nM2,
sizeof(__pyx_k_pcBar_nM2), 0, 0, 1, 1},
23875 {&__pyx_n_s_phi_eN, __pyx_k_phi_eN,
sizeof(__pyx_k_phi_eN), 0, 0, 1, 1},
23876 {&__pyx_n_s_phi_neig, __pyx_k_phi_neig,
sizeof(__pyx_k_phi_neig), 0, 0, 1, 1},
23877 {&__pyx_n_s_pi, __pyx_k_pi,
sizeof(__pyx_k_pi), 0, 0, 1, 1},
23878 {&__pyx_n_s_picard, __pyx_k_picard,
sizeof(__pyx_k_picard), 0, 0, 1, 1},
23879 {&__pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_k_proteus_subsurfaceTransportFunct,
sizeof(__pyx_k_proteus_subsurfaceTransportFunct), 0, 0, 1, 0},
23880 {&__pyx_n_s_psiC, __pyx_k_psiC,
sizeof(__pyx_k_psiC), 0, 0, 1, 1},
23881 {&__pyx_n_s_q, __pyx_k_q,
sizeof(__pyx_k_q), 0, 0, 1, 1},
23882 {&__pyx_n_s_q_alin, __pyx_k_q_alin,
sizeof(__pyx_k_q_alin), 0, 0, 1, 1},
23883 {&__pyx_n_s_q_detJ, __pyx_k_q_detJ,
sizeof(__pyx_k_q_detJ), 0, 0, 1, 1},
23884 {&__pyx_n_s_q_dkr, __pyx_k_q_dkr,
sizeof(__pyx_k_q_dkr), 0, 0, 1, 1},
23885 {&__pyx_n_s_q_dm, __pyx_k_q_dm,
sizeof(__pyx_k_q_dm), 0, 0, 1, 1},
23886 {&__pyx_n_s_q_dmass, __pyx_k_q_dmass,
sizeof(__pyx_k_q_dmass), 0, 0, 1, 1},
23887 {&__pyx_n_s_q_dmt, __pyx_k_q_dmt,
sizeof(__pyx_k_q_dmt), 0, 0, 1, 1},
23888 {&__pyx_n_s_q_flin, __pyx_k_q_flin,
sizeof(__pyx_k_q_flin), 0, 0, 1, 1},
23889 {&__pyx_n_s_q_grad_u, __pyx_k_q_grad_u,
sizeof(__pyx_k_q_grad_u), 0, 0, 1, 1},
23890 {&__pyx_n_s_q_grad_v, __pyx_k_q_grad_v,
sizeof(__pyx_k_q_grad_v), 0, 0, 1, 1},
23891 {&__pyx_n_s_q_grad_w, __pyx_k_q_grad_w,
sizeof(__pyx_k_q_grad_w), 0, 0, 1, 1},
23892 {&__pyx_n_s_q_kr, __pyx_k_q_kr,
sizeof(__pyx_k_q_kr), 0, 0, 1, 1},
23893 {&__pyx_n_s_q_kr_up, __pyx_k_q_kr_up,
sizeof(__pyx_k_q_kr_up), 0, 0, 1, 1},
23894 {&__pyx_n_s_q_m, __pyx_k_q_m,
sizeof(__pyx_k_q_m), 0, 0, 1, 1},
23895 {&__pyx_n_s_q_mass, __pyx_k_q_mass,
sizeof(__pyx_k_q_mass), 0, 0, 1, 1},
23896 {&__pyx_n_s_q_mt, __pyx_k_q_mt,
sizeof(__pyx_k_q_mt), 0, 0, 1, 1},
23897 {&__pyx_n_s_q_r, __pyx_k_q_r,
sizeof(__pyx_k_q_r), 0, 0, 1, 1},
23898 {&__pyx_n_s_q_u, __pyx_k_q_u,
sizeof(__pyx_k_q_u), 0, 0, 1, 1},
23899 {&__pyx_n_s_q_vals, __pyx_k_q_vals,
sizeof(__pyx_k_q_vals), 0, 0, 1, 1},
23900 {&__pyx_n_s_q_x, __pyx_k_q_x,
sizeof(__pyx_k_q_x), 0, 0, 1, 1},
23901 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
23902 {&__pyx_n_s_rho, __pyx_k_rho,
sizeof(__pyx_k_rho), 0, 0, 1, 1},
23903 {&__pyx_n_s_rho2, __pyx_k_rho2,
sizeof(__pyx_k_rho2), 0, 0, 1, 1},
23904 {&__pyx_n_s_rhom, __pyx_k_rhom,
sizeof(__pyx_k_rhom), 0, 0, 1, 1},
23905 {&__pyx_n_s_rotatingGaussianElementVelocityE, __pyx_k_rotatingGaussianElementVelocityE,
sizeof(__pyx_k_rotatingGaussianElementVelocityE), 0, 0, 1, 1},
23906 {&__pyx_n_s_rotatingGaussianElementVelocityE_2, __pyx_k_rotatingGaussianElementVelocityE_2,
sizeof(__pyx_k_rotatingGaussianElementVelocityE_2), 0, 0, 1, 1},
23907 {&__pyx_n_s_rowptr, __pyx_k_rowptr,
sizeof(__pyx_k_rowptr), 0, 0, 1, 1},
23908 {&__pyx_n_s_sBar, __pyx_k_sBar,
sizeof(__pyx_k_sBar), 0, 0, 1, 1},
23909 {&__pyx_n_s_setElementBoundariesArray, __pyx_k_setElementBoundariesArray,
sizeof(__pyx_k_setElementBoundariesArray), 0, 0, 1, 1},
23910 {&__pyx_n_s_setExteriorElementBoundaryTypes, __pyx_k_setExteriorElementBoundaryTypes,
sizeof(__pyx_k_setExteriorElementBoundaryTypes), 0, 0, 1, 1},
23911 {&__pyx_n_s_setScalarMaterialFunctionOverEle, __pyx_k_setScalarMaterialFunctionOverEle,
sizeof(__pyx_k_setScalarMaterialFunctionOverEle), 0, 0, 1, 1},
23912 {&__pyx_n_s_setScalarMaterialFunctionOverEle_2, __pyx_k_setScalarMaterialFunctionOverEle_2,
sizeof(__pyx_k_setScalarMaterialFunctionOverEle_2), 0, 0, 1, 1},
23913 {&__pyx_n_s_setScalarMaterialFunctionOverGlo, __pyx_k_setScalarMaterialFunctionOverGlo,
sizeof(__pyx_k_setScalarMaterialFunctionOverGlo), 0, 0, 1, 1},
23914 {&__pyx_n_s_setSparseTensorMaterialFunctionO, __pyx_k_setSparseTensorMaterialFunctionO,
sizeof(__pyx_k_setSparseTensorMaterialFunctionO), 0, 0, 1, 1},
23915 {&__pyx_n_s_setSparseTensorMaterialFunctionO_2, __pyx_k_setSparseTensorMaterialFunctionO_2,
sizeof(__pyx_k_setSparseTensorMaterialFunctionO_2), 0, 0, 1, 1},
23916 {&__pyx_n_s_setVectorMaterialFunctionOverEle, __pyx_k_setVectorMaterialFunctionOverEle,
sizeof(__pyx_k_setVectorMaterialFunctionOverEle), 0, 0, 1, 1},
23917 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
23918 {&__pyx_n_s_sqrt_sBar, __pyx_k_sqrt_sBar,
sizeof(__pyx_k_sqrt_sBar), 0, 0, 1, 1},
23919 {&__pyx_n_s_subsurfaceTransportFunctions, __pyx_k_subsurfaceTransportFunctions,
sizeof(__pyx_k_subsurfaceTransportFunctions), 0, 0, 1, 1},
23920 {&__pyx_n_s_sum, __pyx_k_sum,
sizeof(__pyx_k_sum), 0, 0, 1, 1},
23921 {&__pyx_n_s_t, __pyx_k_t,
sizeof(__pyx_k_t), 0, 0, 1, 1},
23922 {&__pyx_n_s_tForReversal, __pyx_k_tForReversal,
sizeof(__pyx_k_tForReversal), 0, 0, 1, 1},
23923 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
23924 {&__pyx_n_s_thetaR, __pyx_k_thetaR,
sizeof(__pyx_k_thetaR), 0, 0, 1, 1},
23925 {&__pyx_n_s_thetaS, __pyx_k_thetaS,
sizeof(__pyx_k_thetaS), 0, 0, 1, 1},
23926 {&__pyx_n_s_thetaSR, __pyx_k_thetaSR,
sizeof(__pyx_k_thetaSR), 0, 0, 1, 1},
23927 {&__pyx_n_s_thetaW, __pyx_k_thetaW,
sizeof(__pyx_k_thetaW), 0, 0, 1, 1},
23928 {&__pyx_n_s_thisElementIsUpwind, __pyx_k_thisElementIsUpwind,
sizeof(__pyx_k_thisElementIsUpwind), 0, 0, 1, 1},
23929 {&__pyx_n_s_transient, __pyx_k_transient,
sizeof(__pyx_k_transient), 0, 0, 1, 1},
23930 {&__pyx_n_s_u_dof, __pyx_k_u_dof,
sizeof(__pyx_k_u_dof), 0, 0, 1, 1},
23931 {&__pyx_n_s_u_eN, __pyx_k_u_eN,
sizeof(__pyx_k_u_eN), 0, 0, 1, 1},
23932 {&__pyx_n_s_u_j, __pyx_k_u_j,
sizeof(__pyx_k_u_j), 0, 0, 1, 1},
23933 {&__pyx_n_s_u_l2g, __pyx_k_u_l2g,
sizeof(__pyx_k_u_l2g), 0, 0, 1, 1},
23934 {&__pyx_n_s_u_neig, __pyx_k_u_neig,
sizeof(__pyx_k_u_neig), 0, 0, 1, 1},
23935 {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd,
sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
23936 {&__pyx_n_s_updateMassJacobian_weakAvg, __pyx_k_updateMassJacobian_weakAvg,
sizeof(__pyx_k_updateMassJacobian_weakAvg), 0, 0, 1, 1},
23937 {&__pyx_n_s_updateMass_weakAvg, __pyx_k_updateMass_weakAvg,
sizeof(__pyx_k_updateMass_weakAvg), 0, 0, 1, 1},
23938 {&__pyx_n_s_upwindFlag, __pyx_k_upwindFlag,
sizeof(__pyx_k_upwindFlag), 0, 0, 1, 1},
23939 {&__pyx_n_s_v, __pyx_k_v,
sizeof(__pyx_k_v), 0, 0, 1, 1},
23940 {&__pyx_n_s_vBar, __pyx_k_vBar,
sizeof(__pyx_k_vBar), 0, 0, 1, 1},
23941 {&__pyx_n_s_vBar2, __pyx_k_vBar2,
sizeof(__pyx_k_vBar2), 0, 0, 1, 1},
23942 {&__pyx_n_s_vol, __pyx_k_vol,
sizeof(__pyx_k_vol), 0, 0, 1, 1},
23943 {&__pyx_n_s_volFactor, __pyx_k_volFactor,
sizeof(__pyx_k_volFactor), 0, 0, 1, 1},
23944 {&__pyx_n_s_vol_e, __pyx_k_vol_e,
sizeof(__pyx_k_vol_e), 0, 0, 1, 1},
23945 {&__pyx_n_s_volume, __pyx_k_volume,
sizeof(__pyx_k_volume), 0, 0, 1, 1},
23946 {&__pyx_n_s_vortexElementVelocityEval3, __pyx_k_vortexElementVelocityEval3,
sizeof(__pyx_k_vortexElementVelocityEval3), 0, 0, 1, 1},
23947 {&__pyx_n_s_vortexElementVelocityEval4, __pyx_k_vortexElementVelocityEval4,
sizeof(__pyx_k_vortexElementVelocityEval4), 0, 0, 1, 1},
23948 {&__pyx_n_s_w, __pyx_k_w,
sizeof(__pyx_k_w), 0, 0, 1, 1},
23949 {&__pyx_n_s_weak_residual, __pyx_k_weak_residual,
sizeof(__pyx_k_weak_residual), 0, 0, 1, 1},
23950 {&__pyx_n_s_weight, __pyx_k_weight,
sizeof(__pyx_k_weight), 0, 0, 1, 1},
23951 {&__pyx_n_s_x, __pyx_k_x,
sizeof(__pyx_k_x), 0, 0, 1, 1},
23952 {&__pyx_n_s_xc, __pyx_k_xc,
sizeof(__pyx_k_xc), 0, 0, 1, 1},
23953 {&__pyx_n_s_yc, __pyx_k_yc,
sizeof(__pyx_k_yc), 0, 0, 1, 1},
23954 {&__pyx_n_s_zVelocity, __pyx_k_zVelocity,
sizeof(__pyx_k_zVelocity), 0, 0, 1, 1},
23955 {&__pyx_n_s_zeros, __pyx_k_zeros,
sizeof(__pyx_k_zeros), 0, 0, 1, 1},
23956 {&__pyx_n_s_zvelocity, __pyx_k_zvelocity,
sizeof(__pyx_k_zvelocity), 0, 0, 1, 1},
23957 {0, 0, 0, 0, 0, 0, 0}
23959 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
23960 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 24, __pyx_L1_error)
23961 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(1, 272, __pyx_L1_error)
23962 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 856, __pyx_L1_error)
23963 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1038, __pyx_L1_error)
23969 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
23970 __Pyx_RefNannyDeclarations
23971 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
23980 __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 66, __pyx_L1_error)
23981 __Pyx_GOTREF(__pyx_slice_);
23982 __Pyx_GIVEREF(__pyx_slice_);
23991 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 272, __pyx_L1_error)
23992 __Pyx_GOTREF(__pyx_tuple__2);
23993 __Pyx_GIVEREF(__pyx_tuple__2);
24002 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 276, __pyx_L1_error)
24003 __Pyx_GOTREF(__pyx_tuple__3);
24004 __Pyx_GIVEREF(__pyx_tuple__3);
24013 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 306, __pyx_L1_error)
24014 __Pyx_GOTREF(__pyx_tuple__4);
24015 __Pyx_GIVEREF(__pyx_tuple__4);
24024 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 856, __pyx_L1_error)
24025 __Pyx_GOTREF(__pyx_tuple__5);
24026 __Pyx_GIVEREF(__pyx_tuple__5);
24035 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 880, __pyx_L1_error)
24036 __Pyx_GOTREF(__pyx_tuple__6);
24037 __Pyx_GIVEREF(__pyx_tuple__6);
24046 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 1038, __pyx_L1_error)
24047 __Pyx_GOTREF(__pyx_tuple__7);
24048 __Pyx_GIVEREF(__pyx_tuple__7);
24057 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 1044, __pyx_L1_error)
24058 __Pyx_GOTREF(__pyx_tuple__8);
24059 __Pyx_GIVEREF(__pyx_tuple__8);
24068 __pyx_tuple__9 = PyTuple_Pack(8, __pyx_n_s_nExteriorElementBoundaries_globa, __pyx_n_s_exteriorElementBoundariesArray, __pyx_n_s_elementBoundaryElementsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_exteriorElementBoundaryMaterialT, __pyx_n_s_ebNE, __pyx_n_s_ebN, __pyx_n_s_eN);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 18, __pyx_L1_error)
24069 __Pyx_GOTREF(__pyx_tuple__9);
24070 __Pyx_GIVEREF(__pyx_tuple__9);
24071 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setExteriorElementBoundaryTypes, 18, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 18, __pyx_L1_error)
24080 __pyx_tuple__11 = PyTuple_Pack(7, __pyx_n_s_nElementBoundaries_global, __pyx_n_s_elementBoundaryElementsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_elementBoundaryMaterialTypes, __pyx_n_s_ebN, __pyx_n_s_eN_left, __pyx_n_s_eN_right);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 29, __pyx_L1_error)
24081 __Pyx_GOTREF(__pyx_tuple__11);
24082 __Pyx_GIVEREF(__pyx_tuple__11);
24083 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setElementBoundariesArray, 29, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 29, __pyx_L1_error)
24092 __pyx_tuple__13 = PyTuple_Pack(6, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 43, __pyx_L1_error)
24093 __Pyx_GOTREF(__pyx_tuple__13);
24094 __Pyx_GIVEREF(__pyx_tuple__13);
24095 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setScalarMaterialFunctionOverEle, 43, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 43, __pyx_L1_error)
24104 __pyx_tuple__15 = PyTuple_Pack(6, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 56, __pyx_L1_error)
24105 __Pyx_GOTREF(__pyx_tuple__15);
24106 __Pyx_GIVEREF(__pyx_tuple__15);
24107 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setVectorMaterialFunctionOverEle, 56, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 56, __pyx_L1_error)
24116 __pyx_tuple__17 = PyTuple_Pack(10, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 69, __pyx_L1_error)
24117 __Pyx_GOTREF(__pyx_tuple__17);
24118 __Pyx_GIVEREF(__pyx_tuple__17);
24119 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setScalarMaterialFunctionOverEle_2, 69, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 69, __pyx_L1_error)
24128 __pyx_tuple__19 = PyTuple_Pack(15, __pyx_n_s_nd, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 91, __pyx_L1_error)
24129 __Pyx_GOTREF(__pyx_tuple__19);
24130 __Pyx_GIVEREF(__pyx_tuple__19);
24131 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setSparseTensorMaterialFunctionO, 91, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 91, __pyx_L1_error)
24140 __pyx_tuple__21 = PyTuple_Pack(8, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_k);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 118, __pyx_L1_error)
24141 __Pyx_GOTREF(__pyx_tuple__21);
24142 __Pyx_GIVEREF(__pyx_tuple__21);
24143 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setScalarMaterialFunctionOverGlo, 118, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 118, __pyx_L1_error)
24152 __pyx_tuple__23 = PyTuple_Pack(13, __pyx_n_s_nd, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 139, __pyx_L1_error)
24153 __Pyx_GOTREF(__pyx_tuple__23);
24154 __Pyx_GIVEREF(__pyx_tuple__23);
24155 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setSparseTensorMaterialFunctionO_2, 139, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 139, __pyx_L1_error)
24164 __pyx_tuple__25 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_elementMaterialTypes, __pyx_n_s_x, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 165, __pyx_L1_error)
24165 __Pyx_GOTREF(__pyx_tuple__25);
24166 __Pyx_GIVEREF(__pyx_tuple__25);
24167 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateScalarMaterialFunctionOv, 165, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 165, __pyx_L1_error)
24176 __pyx_tuple__27 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_elementMaterialTypes, __pyx_n_s_x, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 180, __pyx_L1_error)
24177 __Pyx_GOTREF(__pyx_tuple__27);
24178 __Pyx_GIVEREF(__pyx_tuple__27);
24179 __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateVectorMaterialFunctionOv, 180, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 180, __pyx_L1_error)
24188 __pyx_tuple__29 = PyTuple_Pack(12, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 195, __pyx_L1_error)
24189 __Pyx_GOTREF(__pyx_tuple__29);
24190 __Pyx_GIVEREF(__pyx_tuple__29);
24191 __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(6, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateScalarMaterialFunctionOv_2, 195, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 195, __pyx_L1_error)
24200 __pyx_tuple__31 = PyTuple_Pack(17, __pyx_n_s_nd, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 219, __pyx_L1_error)
24201 __Pyx_GOTREF(__pyx_tuple__31);
24202 __Pyx_GIVEREF(__pyx_tuple__31);
24203 __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(7, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateSparseTensorMaterialFunc, 219, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 219, __pyx_L1_error)
24212 __pyx_tuple__33 = PyTuple_Pack(10, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_k);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 248, __pyx_L1_error)
24213 __Pyx_GOTREF(__pyx_tuple__33);
24214 __Pyx_GIVEREF(__pyx_tuple__33);
24215 __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(6, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateScalarMaterialFunctionOv_3, 248, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 248, __pyx_L1_error)
24224 __pyx_tuple__35 = PyTuple_Pack(15, __pyx_n_s_nd, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 271, __pyx_L1_error)
24225 __Pyx_GOTREF(__pyx_tuple__35);
24226 __Pyx_GIVEREF(__pyx_tuple__35);
24227 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(7, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateSparseTensorMaterialFunc_2, 271, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 271, __pyx_L1_error)
24236 __pyx_tuple__37 = PyTuple_Pack(24, __pyx_n_s_rho, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_KWs, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_ebN, __pyx_n_s_matID, __pyx_n_s_matID_neig, __pyx_n_s_nSpace2, __pyx_n_s_nnz, __pyx_n_s_a_eN, __pyx_n_s_a_neig, __pyx_n_s_a_avg);
if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 301, __pyx_L1_error)
24237 __Pyx_GOTREF(__pyx_tuple__37);
24238 __Pyx_GIVEREF(__pyx_tuple__37);
24239 __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(12, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_evaluateElementCoefficie, 301, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 301, __pyx_L1_error)
24248 __pyx_tuple__39 = PyTuple_Pack(61, __pyx_n_s_rho, __pyx_n_s_beta, __pyx_n_s_gravity, __pyx_n_s_alpha, __pyx_n_s_n, __pyx_n_s_thetaR, __pyx_n_s_thetaSR, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_nDOF_trial_element, __pyx_n_s_u_l2g, __pyx_n_s_u_dof, __pyx_n_s_q_x, __pyx_n_s_q_u, __pyx_n_s_q_mass, __pyx_n_s_q_dmass, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_dkr, __pyx_n_s_q_kr_up, __pyx_n_s_q, __pyx_n_s_psiC, __pyx_n_s_pcBar, __pyx_n_s_pcBar_n, __pyx_n_s_pcBar_nM1, __pyx_n_s_pcBar_nM2, __pyx_n_s_onePlus_pcBar_n, __pyx_n_s_sBar, __pyx_n_s_sqrt_sBar, __pyx_n_s_DsBar_DpsiC, __pyx_n_s_thetaW, __pyx_n_s_DthetaW_DpsiC, __pyx_n_s_vBar, __pyx_n_s_vBar2, __pyx_n_s_DvBar_DpsiC, __pyx_n_s_KWr, __pyx_n_s_DKWr_DpsiC, __pyx_n_s_rho2, __pyx_n_s_thetaS, __pyx_n_s_rhom, __pyx_n_s_drhom, __pyx_n_s_m, __pyx_n_s_u_j, __pyx_n_s_u_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_eN, __pyx_n_s_kr_neig, __pyx_n_s_phi_eN, __pyx_n_s_phi_neig, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ebN, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_j, __pyx_n_s_matID, __pyx_n_s_nAvgWeight);
if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 359, __pyx_L1_error)
24249 __Pyx_GOTREF(__pyx_tuple__39);
24250 __Pyx_GIVEREF(__pyx_tuple__39);
24251 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(24, 0, 61, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, 359, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 359, __pyx_L1_error)
24260 __pyx_tuple__41 = PyTuple_Pack(42, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_nDOF_test_element, __pyx_n_s_q_u, __pyx_n_s_q_grad_u, __pyx_n_s_q_grad_w, __pyx_n_s_q_detJ, __pyx_n_s_q_m, __pyx_n_s_q_mt, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_kr_up, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_elementResidual, __pyx_n_s_upwindFlag, __pyx_n_s_q, __pyx_n_s_nnz, __pyx_n_s_u_eN, __pyx_n_s_kr_eN, __pyx_n_s_phi_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_neig, __pyx_n_s_phi_neig, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_i, __pyx_n_s_ebN, __pyx_n_s_a_up, __pyx_n_s_f_up, __pyx_n_s_nAvgWeight, __pyx_n_s_weight, __pyx_n_s_volFactor, __pyx_n_s_volume);
if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 486, __pyx_L1_error)
24261 __Pyx_GOTREF(__pyx_tuple__41);
24262 __Pyx_GIVEREF(__pyx_tuple__41);
24263 __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(21, 0, 42, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_getElementResidual, 486, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 486, __pyx_L1_error)
24272 __pyx_tuple__43 = PyTuple_Pack(51, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_nDOF_test_element, __pyx_n_s_nDOF_trial_element, __pyx_n_s_q_u, __pyx_n_s_q_grad_u, __pyx_n_s_q_grad_w, __pyx_n_s_q_grad_v, __pyx_n_s_q_detJ, __pyx_n_s_q_m, __pyx_n_s_q_dm, __pyx_n_s_q_mt, __pyx_n_s_q_dmt, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_dkr, __pyx_n_s_q_kr_up, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_elementJacobian, __pyx_n_s_upwindFlag, __pyx_n_s_picard, __pyx_n_s_q, __pyx_n_s_nnz, __pyx_n_s_u_eN, __pyx_n_s_kr_eN, __pyx_n_s_phi_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_neig, __pyx_n_s_phi_neig, __pyx_n_s_dkr_up, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_a_up, __pyx_n_s_f_up, __pyx_n_s_nAvgWeight, __pyx_n_s_weight, __pyx_n_s_volFactor, __pyx_n_s_thisElementIsUpwind, __pyx_n_s_volume, __pyx_n_s_i, __pyx_n_s_ebN, __pyx_n_s_j);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 574, __pyx_L1_error)
24273 __Pyx_GOTREF(__pyx_tuple__43);
24274 __Pyx_GIVEREF(__pyx_tuple__43);
24275 __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(26, 0, 51, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_getElementJacobian, 574, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 574, __pyx_L1_error)
24284 __pyx_tuple__45 = PyTuple_Pack(9, __pyx_n_s_mt, __pyx_n_s_w, __pyx_n_s_dV, __pyx_n_s_weak_residual, __pyx_n_s_eN, __pyx_n_s_i, __pyx_n_s_k, __pyx_n_s_mt_avg, __pyx_n_s_vol);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 673, __pyx_L1_error)
24285 __Pyx_GOTREF(__pyx_tuple__45);
24286 __Pyx_GIVEREF(__pyx_tuple__45);
24287 __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_updateMass_weakAvg, 673, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 673, __pyx_L1_error)
24296 __pyx_tuple__47 = PyTuple_Pack(11, __pyx_n_s_dmt, __pyx_n_s_w, __pyx_n_s_v, __pyx_n_s_dV, __pyx_n_s_jacobian_weak_residual, __pyx_n_s_eN, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_dmtj_avg, __pyx_n_s_vol);
if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 692, __pyx_L1_error)
24297 __Pyx_GOTREF(__pyx_tuple__47);
24298 __Pyx_GIVEREF(__pyx_tuple__47);
24299 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_updateMassJacobian_weakAvg, 692, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 692, __pyx_L1_error)
24308 __pyx_tuple__49 = PyTuple_Pack(9, __pyx_n_s_v, __pyx_n_s_n, __pyx_n_s_dS, __pyx_n_s_flux, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_kb, __pyx_n_s_integral, __pyx_n_s_I);
if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 717, __pyx_L1_error)
24309 __Pyx_GOTREF(__pyx_tuple__49);
24310 __Pyx_GIVEREF(__pyx_tuple__49);
24311 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_calculateNormalFlux, 717, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 717, __pyx_L1_error)
24320 __pyx_tuple__51 = PyTuple_Pack(9, __pyx_n_s_df, __pyx_n_s_characteristic_velocity, __pyx_n_s_dm, __pyx_n_s_dV, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_I, __pyx_n_s_omega_e, __pyx_n_s_vol_e);
if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 732, __pyx_L1_error)
24321 __Pyx_GOTREF(__pyx_tuple__51);
24322 __Pyx_GIVEREF(__pyx_tuple__51);
24323 __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_computeSimpleCharacteristicVeloc, 732, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 732, __pyx_L1_error)
24332 __pyx_tuple__53 = PyTuple_Pack(11, __pyx_n_s_df_dofs, __pyx_n_s_characteristic_velocity_dofs, __pyx_n_s_l2g, __pyx_n_s_dm, __pyx_n_s_dV, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_j, __pyx_n_s_J, __pyx_n_s_omega_e, __pyx_n_s_vol_e);
if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 753, __pyx_L1_error)
24333 __Pyx_GOTREF(__pyx_tuple__53);
24334 __Pyx_GIVEREF(__pyx_tuple__53);
24335 __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_computeSimpleCharacteristicVeloc_2, 753, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 753, __pyx_L1_error)
24344 __pyx_tuple__55 = PyTuple_Pack(12, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_zvelocity, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 776, __pyx_L1_error)
24345 __Pyx_GOTREF(__pyx_tuple__55);
24346 __Pyx_GIVEREF(__pyx_tuple__55);
24347 __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_rotatingGaussianElementVelocityE, 776, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 776, __pyx_L1_error)
24356 __pyx_tuple__57 = PyTuple_Pack(13, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_zvelocity, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 816, __pyx_L1_error)
24357 __Pyx_GOTREF(__pyx_tuple__57);
24358 __Pyx_GIVEREF(__pyx_tuple__57);
24359 __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(9, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_rotatingGaussianElementVelocityE_2, 816, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 816, __pyx_L1_error)
24368 __pyx_tuple__59 = PyTuple_Pack(12, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_zVelocity, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 859, __pyx_L1_error)
24369 __Pyx_GOTREF(__pyx_tuple__59);
24370 __Pyx_GIVEREF(__pyx_tuple__59);
24371 __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_helicalElementVelocityEval3, 859, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 859, __pyx_L1_error)
24380 __pyx_tuple__61 = PyTuple_Pack(13, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_zVelocity, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 884, __pyx_L1_error)
24381 __Pyx_GOTREF(__pyx_tuple__61);
24382 __Pyx_GIVEREF(__pyx_tuple__61);
24383 __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(9, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_helicalElementVelocityEval4, 884, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 884, __pyx_L1_error)
24392 __pyx_tuple__63 = PyTuple_Pack(7, __pyx_n_s_t, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi, __pyx_n_s_one8);
if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 911, __pyx_L1_error)
24393 __Pyx_GOTREF(__pyx_tuple__63);
24394 __Pyx_GIVEREF(__pyx_tuple__63);
24395 __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_vortexElementVelocityEval3, 911, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 911, __pyx_L1_error)
24404 __pyx_tuple__65 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_ebN, __pyx_n_s_pi, __pyx_n_s_one8);
if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 924, __pyx_L1_error)
24405 __Pyx_GOTREF(__pyx_tuple__65);
24406 __Pyx_GIVEREF(__pyx_tuple__65);
24407 __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_vortexElementVelocityEval4, 924, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 924, __pyx_L1_error)
24408 __Pyx_RefNannyFinishContext();
24411 __Pyx_RefNannyFinishContext();
24415 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
24416 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
24417 __pyx_float_0_0 = PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
24418 __pyx_float_0_5 = PyFloat_FromDouble(0.5);
if (unlikely(!__pyx_float_0_5)) __PYX_ERR(0, 1, __pyx_L1_error)
24419 __pyx_float_2_0 = PyFloat_FromDouble(2.0);
if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
24420 __pyx_float_1_0eneg_20 = PyFloat_FromDouble(1.0e-20);
if (unlikely(!__pyx_float_1_0eneg_20)) __PYX_ERR(0, 1, __pyx_L1_error)
24426 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
24427 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
24428 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
24429 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
24430 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
24431 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
24432 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
24434 static int __Pyx_modinit_global_init_code(
void) {
24435 __Pyx_RefNannyDeclarations
24436 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
24438 __Pyx_RefNannyFinishContext();
24442 static int __Pyx_modinit_variable_export_code(
void) {
24443 __Pyx_RefNannyDeclarations
24444 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
24446 __Pyx_RefNannyFinishContext();
24450 static int __Pyx_modinit_function_export_code(
void) {
24451 __Pyx_RefNannyDeclarations
24452 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
24454 __Pyx_RefNannyFinishContext();
24458 static int __Pyx_modinit_type_init_code(
void) {
24459 __Pyx_RefNannyDeclarations
24460 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
24462 __Pyx_RefNannyFinishContext();
24466 static int __Pyx_modinit_type_import_code(
void) {
24467 __Pyx_RefNannyDeclarations
24468 PyObject *__pyx_t_1 = NULL;
24469 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
24471 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
24472 __Pyx_GOTREF(__pyx_t_1);
24473 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
24474 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24475 sizeof(PyTypeObject),
24477 sizeof(PyHeapTypeObject),
24479 __Pyx_ImportType_CheckSize_Warn);
24480 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
24481 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24482 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 206, __pyx_L1_error)
24483 __Pyx_GOTREF(__pyx_t_1);
24484 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
24485 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 206, __pyx_L1_error)
24486 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
24487 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 229, __pyx_L1_error)
24488 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
24489 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 233, __pyx_L1_error)
24490 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
24491 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 242, __pyx_L1_error)
24492 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
24493 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 918, __pyx_L1_error)
24494 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24495 __Pyx_RefNannyFinishContext();
24498 __Pyx_XDECREF(__pyx_t_1);
24499 __Pyx_RefNannyFinishContext();
24503 static int __Pyx_modinit_variable_import_code(
void) {
24504 __Pyx_RefNannyDeclarations
24505 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
24507 __Pyx_RefNannyFinishContext();
24511 static int __Pyx_modinit_function_import_code(
void) {
24512 __Pyx_RefNannyDeclarations
24513 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
24515 __Pyx_RefNannyFinishContext();
24520 #if PY_MAJOR_VERSION < 3 24521 #ifdef CYTHON_NO_PYINIT_EXPORT 24522 #define __Pyx_PyMODINIT_FUNC void 24524 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 24527 #ifdef CYTHON_NO_PYINIT_EXPORT 24528 #define __Pyx_PyMODINIT_FUNC PyObject * 24530 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 24535 #if PY_MAJOR_VERSION < 3 24536 __Pyx_PyMODINIT_FUNC initsubsurfaceTransportFunctions(
void) CYTHON_SMALL_CODE;
24537 __Pyx_PyMODINIT_FUNC initsubsurfaceTransportFunctions(
void)
24539 __Pyx_PyMODINIT_FUNC PyInit_subsurfaceTransportFunctions(
void) CYTHON_SMALL_CODE;
24540 __Pyx_PyMODINIT_FUNC PyInit_subsurfaceTransportFunctions(
void)
24541 #if CYTHON_PEP489_MULTI_PHASE_INIT 24543 return PyModuleDef_Init(&__pyx_moduledef);
24545 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
24546 #if PY_VERSION_HEX >= 0x030700A1 24547 static PY_INT64_T main_interpreter_id = -1;
24548 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
24549 if (main_interpreter_id == -1) {
24550 main_interpreter_id = current_id;
24551 return (unlikely(current_id == -1)) ? -1 : 0;
24552 }
else if (unlikely(main_interpreter_id != current_id))
24554 static PyInterpreterState *main_interpreter = NULL;
24555 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
24556 if (!main_interpreter) {
24557 main_interpreter = current_interpreter;
24558 }
else if (unlikely(main_interpreter != current_interpreter))
24563 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
24568 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
24569 PyObject *value = PyObject_GetAttrString(spec, from_name);
24571 if (likely(value)) {
24572 if (allow_none || value != Py_None) {
24573 result = PyDict_SetItemString(moddict, to_name, value);
24576 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
24583 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
24584 PyObject *module = NULL, *moddict, *modname;
24585 if (__Pyx_check_single_interpreter())
24588 return __Pyx_NewRef(__pyx_m);
24589 modname = PyObject_GetAttrString(spec,
"name");
24590 if (unlikely(!modname))
goto bad;
24591 module = PyModule_NewObject(modname);
24592 Py_DECREF(modname);
24593 if (unlikely(!module))
goto bad;
24594 moddict = PyModule_GetDict(module);
24595 if (unlikely(!moddict))
goto bad;
24596 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
24597 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
24598 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
24599 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
24602 Py_XDECREF(module);
24607 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_subsurfaceTransportFunctions(PyObject *__pyx_pyinit_module)
24611 PyObject *__pyx_t_1 = NULL;
24612 __Pyx_RefNannyDeclarations
24613 #if CYTHON_PEP489_MULTI_PHASE_INIT 24615 if (__pyx_m == __pyx_pyinit_module)
return 0;
24616 PyErr_SetString(PyExc_RuntimeError,
"Module 'subsurfaceTransportFunctions' has already been imported. Re-initialisation is not supported.");
24619 #elif PY_MAJOR_VERSION >= 3 24620 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
24622 #if CYTHON_REFNANNY 24623 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
24624 if (!__Pyx_RefNanny) {
24626 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
24627 if (!__Pyx_RefNanny)
24628 Py_FatalError(
"failed to import 'refnanny' module");
24631 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_subsurfaceTransportFunctions(void)", 0);
24632 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24633 #ifdef __Pxy_PyFrame_Initialize_Offsets 24634 __Pxy_PyFrame_Initialize_Offsets();
24636 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
24637 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
24638 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
24639 #ifdef __Pyx_CyFunction_USED 24640 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24642 #ifdef __Pyx_FusedFunction_USED 24643 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24645 #ifdef __Pyx_Coroutine_USED 24646 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24648 #ifdef __Pyx_Generator_USED 24649 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24651 #ifdef __Pyx_AsyncGen_USED 24652 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24654 #ifdef __Pyx_StopAsyncIteration_USED 24655 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24659 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS 24661 PyEval_InitThreads();
24665 #if CYTHON_PEP489_MULTI_PHASE_INIT 24666 __pyx_m = __pyx_pyinit_module;
24667 Py_INCREF(__pyx_m);
24669 #if PY_MAJOR_VERSION < 3 24670 __pyx_m = Py_InitModule4(
"subsurfaceTransportFunctions", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
24672 __pyx_m = PyModule_Create(&__pyx_moduledef);
24674 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
24676 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
24677 Py_INCREF(__pyx_d);
24678 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
24679 Py_INCREF(__pyx_b);
24680 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
24681 Py_INCREF(__pyx_cython_runtime);
24682 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
24684 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24685 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) 24686 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24688 if (__pyx_module_is_main_subsurfaceTransportFunctions) {
24689 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24691 #if PY_MAJOR_VERSION >= 3 24693 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
24694 if (!PyDict_GetItemString(modules,
"subsurfaceTransportFunctions")) {
24695 if (unlikely(PyDict_SetItemString(modules,
"subsurfaceTransportFunctions", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
24700 if (__Pyx_InitCachedBuiltins() < 0)
goto __pyx_L1_error;
24702 if (__Pyx_InitCachedConstants() < 0)
goto __pyx_L1_error;
24704 (void)__Pyx_modinit_global_init_code();
24705 (void)__Pyx_modinit_variable_export_code();
24706 (void)__Pyx_modinit_function_export_code();
24707 (void)__Pyx_modinit_type_init_code();
24708 if (unlikely(__Pyx_modinit_type_import_code() != 0))
goto __pyx_L1_error;
24709 (void)__Pyx_modinit_variable_import_code();
24710 (void)__Pyx_modinit_function_import_code();
24712 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 24713 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24721 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24722 __Pyx_GOTREF(__pyx_t_1);
24723 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24724 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24733 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
24734 __Pyx_GOTREF(__pyx_t_1);
24735 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setExteriorElementBoundaryTypes, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
24736 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24745 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_3setElementBoundariesArray, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
24746 __Pyx_GOTREF(__pyx_t_1);
24747 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setElementBoundariesArray, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
24748 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24757 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
24758 __Pyx_GOTREF(__pyx_t_1);
24759 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverEle, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
24760 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24769 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
24770 __Pyx_GOTREF(__pyx_t_1);
24771 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setVectorMaterialFunctionOverEle, __pyx_t_1) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
24772 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24781 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
24782 __Pyx_GOTREF(__pyx_t_1);
24783 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverEle_2, __pyx_t_1) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
24784 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24793 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
24794 __Pyx_GOTREF(__pyx_t_1);
24795 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setSparseTensorMaterialFunctionO, __pyx_t_1) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
24796 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24805 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
24806 __Pyx_GOTREF(__pyx_t_1);
24807 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverGlo, __pyx_t_1) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
24808 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24817 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
24818 __Pyx_GOTREF(__pyx_t_1);
24819 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setSparseTensorMaterialFunctionO_2, __pyx_t_1) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
24820 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24829 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
24830 __Pyx_GOTREF(__pyx_t_1);
24831 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
24832 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24841 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error)
24842 __Pyx_GOTREF(__pyx_t_1);
24843 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateVectorMaterialFunctionOv, __pyx_t_1) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
24844 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24853 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
24854 __Pyx_GOTREF(__pyx_t_1);
24855 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv_2, __pyx_t_1) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
24856 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24865 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
24866 __Pyx_GOTREF(__pyx_t_1);
24867 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateSparseTensorMaterialFunc, __pyx_t_1) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
24868 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24877 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
24878 __Pyx_GOTREF(__pyx_t_1);
24879 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv_3, __pyx_t_1) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
24880 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24889 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
24890 __Pyx_GOTREF(__pyx_t_1);
24891 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateSparseTensorMaterialFunc_2, __pyx_t_1) < 0) __PYX_ERR(0, 271, __pyx_L1_error)
24892 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24901 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
24902 __Pyx_GOTREF(__pyx_t_1);
24903 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_evaluateElementCoefficie, __pyx_t_1) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
24904 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24913 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
24914 __Pyx_GOTREF(__pyx_t_1);
24915 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, __pyx_t_1) < 0) __PYX_ERR(0, 359, __pyx_L1_error)
24916 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24925 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
24926 __Pyx_GOTREF(__pyx_t_1);
24927 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_getElementResidual, __pyx_t_1) < 0) __PYX_ERR(0, 486, __pyx_L1_error)
24928 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24937 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error)
24938 __Pyx_GOTREF(__pyx_t_1);
24939 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_getElementJacobian, __pyx_t_1) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
24940 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24949 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_37updateMass_weakAvg, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
24950 __Pyx_GOTREF(__pyx_t_1);
24951 if (PyDict_SetItem(__pyx_d, __pyx_n_s_updateMass_weakAvg, __pyx_t_1) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
24952 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24961 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
24962 __Pyx_GOTREF(__pyx_t_1);
24963 if (PyDict_SetItem(__pyx_d, __pyx_n_s_updateMassJacobian_weakAvg, __pyx_t_1) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
24964 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24973 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_41calculateNormalFlux, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
24974 __Pyx_GOTREF(__pyx_t_1);
24975 if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateNormalFlux, __pyx_t_1) < 0) __PYX_ERR(0, 717, __pyx_L1_error)
24976 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24985 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __pyx_L1_error)
24986 __Pyx_GOTREF(__pyx_t_1);
24987 if (PyDict_SetItem(__pyx_d, __pyx_n_s_computeSimpleCharacteristicVeloc, __pyx_t_1) < 0) __PYX_ERR(0, 732, __pyx_L1_error)
24988 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24997 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
24998 __Pyx_GOTREF(__pyx_t_1);
24999 if (PyDict_SetItem(__pyx_d, __pyx_n_s_computeSimpleCharacteristicVeloc_2, __pyx_t_1) < 0) __PYX_ERR(0, 753, __pyx_L1_error)
25000 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25009 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error)
25010 __Pyx_GOTREF(__pyx_t_1);
25011 if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotatingGaussianElementVelocityE, __pyx_t_1) < 0) __PYX_ERR(0, 776, __pyx_L1_error)
25012 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25021 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error)
25022 __Pyx_GOTREF(__pyx_t_1);
25023 if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotatingGaussianElementVelocityE_2, __pyx_t_1) < 0) __PYX_ERR(0, 816, __pyx_L1_error)
25024 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25033 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_51helicalElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error)
25034 __Pyx_GOTREF(__pyx_t_1);
25035 if (PyDict_SetItem(__pyx_d, __pyx_n_s_helicalElementVelocityEval3, __pyx_t_1) < 0) __PYX_ERR(0, 859, __pyx_L1_error)
25036 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25045 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_53helicalElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
25046 __Pyx_GOTREF(__pyx_t_1);
25047 if (PyDict_SetItem(__pyx_d, __pyx_n_s_helicalElementVelocityEval4, __pyx_t_1) < 0) __PYX_ERR(0, 884, __pyx_L1_error)
25048 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25057 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_55vortexElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error)
25058 __Pyx_GOTREF(__pyx_t_1);
25059 if (PyDict_SetItem(__pyx_d, __pyx_n_s_vortexElementVelocityEval3, __pyx_t_1) < 0) __PYX_ERR(0, 911, __pyx_L1_error)
25060 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25069 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_57vortexElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error)
25070 __Pyx_GOTREF(__pyx_t_1);
25071 if (PyDict_SetItem(__pyx_d, __pyx_n_s_vortexElementVelocityEval4, __pyx_t_1) < 0) __PYX_ERR(0, 924, __pyx_L1_error)
25072 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25079 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
25080 __Pyx_GOTREF(__pyx_t_1);
25081 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25082 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25096 __Pyx_XDECREF(__pyx_t_1);
25099 __Pyx_AddTraceback(
"init subsurfaceTransportFunctions", __pyx_clineno, __pyx_lineno, __pyx_filename);
25102 }
else if (!PyErr_Occurred()) {
25103 PyErr_SetString(PyExc_ImportError,
"init subsurfaceTransportFunctions");
25106 __Pyx_RefNannyFinishContext();
25107 #if CYTHON_PEP489_MULTI_PHASE_INIT 25108 return (__pyx_m != NULL) ? 0 : -1;
25109 #elif PY_MAJOR_VERSION >= 3 25118 #if CYTHON_REFNANNY 25119 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
25120 PyObject *m = NULL, *p = NULL;
25122 m = PyImport_ImportModule(modname);
25124 p = PyObject_GetAttrString(m,
"RefNannyAPI");
25126 r = PyLong_AsVoidPtr(p);
25130 return (__Pyx_RefNannyAPIStruct *)
r;
25135 #if CYTHON_USE_TYPE_SLOTS 25136 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
25137 PyTypeObject* tp = Py_TYPE(obj);
25138 if (likely(tp->tp_getattro))
25139 return tp->tp_getattro(obj, attr_name);
25140 #if PY_MAJOR_VERSION < 3 25141 if (likely(tp->tp_getattr))
25142 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
25144 return PyObject_GetAttr(obj, attr_name);
25149 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
25150 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
25151 if (unlikely(!result)) {
25152 PyErr_Format(PyExc_NameError,
25153 #
if PY_MAJOR_VERSION >= 3
25154 "name '%U' is not defined", name);
25156 "name '%.200s' is not defined", PyString_AS_STRING(name));
25163 static void __Pyx_RaiseArgtupleInvalid(
25164 const char* func_name,
25166 Py_ssize_t num_min,
25167 Py_ssize_t num_max,
25168 Py_ssize_t num_found)
25170 Py_ssize_t num_expected;
25171 const char *more_or_less;
25172 if (num_found < num_min) {
25173 num_expected = num_min;
25174 more_or_less =
"at least";
25176 num_expected = num_max;
25177 more_or_less =
"at most";
25180 more_or_less =
"exactly";
25182 PyErr_Format(PyExc_TypeError,
25183 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
25184 func_name, more_or_less, num_expected,
25185 (num_expected == 1) ?
"" :
"s", num_found);
25189 static void __Pyx_RaiseDoubleKeywordsError(
25190 const char* func_name,
25193 PyErr_Format(PyExc_TypeError,
25194 #
if PY_MAJOR_VERSION >= 3
25195 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
25197 "%s() got multiple values for keyword argument '%s'", func_name,
25198 PyString_AsString(kw_name));
25203 static int __Pyx_ParseOptionalKeywords(
25205 PyObject **argnames[],
25207 PyObject *values[],
25208 Py_ssize_t num_pos_args,
25209 const char* function_name)
25211 PyObject *key = 0, *value = 0;
25212 Py_ssize_t
pos = 0;
25214 PyObject*** first_kw_arg = argnames + num_pos_args;
25215 while (PyDict_Next(kwds, &pos, &key, &value)) {
25216 name = first_kw_arg;
25217 while (*name && (**name != key)) name++;
25219 values[name-argnames] = value;
25222 name = first_kw_arg;
25223 #if PY_MAJOR_VERSION < 3 25224 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
25226 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
25227 && _PyString_Eq(**name, key)) {
25228 values[name-argnames] = value;
25233 if (*name)
continue;
25235 PyObject*** argname = argnames;
25236 while (argname != first_kw_arg) {
25237 if ((**argname == key) || (
25238 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
25239 && _PyString_Eq(**argname, key))) {
25240 goto arg_passed_twice;
25247 if (likely(PyUnicode_Check(key))) {
25249 int cmp = (**name == key) ? 0 :
25250 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
25251 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
25253 PyUnicode_Compare(**name, key);
25254 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
25256 values[name-argnames] = value;
25261 if (*name)
continue;
25263 PyObject*** argname = argnames;
25264 while (argname != first_kw_arg) {
25265 int cmp = (**argname == key) ? 0 :
25266 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
25267 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
25269 PyUnicode_Compare(**argname, key);
25270 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
25271 if (cmp == 0)
goto arg_passed_twice;
25276 goto invalid_keyword_type;
25278 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
25280 goto invalid_keyword;
25285 __Pyx_RaiseDoubleKeywordsError(function_name, key);
25287 invalid_keyword_type:
25288 PyErr_Format(PyExc_TypeError,
25289 "%.200s() keywords must be strings", function_name);
25292 PyErr_Format(PyExc_TypeError,
25293 #
if PY_MAJOR_VERSION < 3
25294 "%.200s() got an unexpected keyword argument '%.200s'",
25295 function_name, PyString_AsString(key));
25297 "%s() got an unexpected keyword argument '%U'",
25298 function_name, key);
25305 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
25307 if (unlikely(!type)) {
25308 PyErr_SetString(PyExc_SystemError,
"Missing type object");
25312 #if PY_MAJOR_VERSION == 2 25313 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
25317 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
25319 PyErr_Format(PyExc_TypeError,
25320 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
25321 name, type->tp_name, Py_TYPE(obj)->tp_name);
25326 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
25332 S.u32 = 0x01020304;
25333 return S.u8[0] == 4;
25337 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
25338 __Pyx_BufFmt_StackElem* stack,
25339 __Pyx_TypeInfo* type) {
25340 stack[0].field = &ctx->root;
25341 stack[0].parent_offset = 0;
25342 ctx->root.type = type;
25343 ctx->root.name =
"buffer dtype";
25344 ctx->root.offset = 0;
25346 ctx->head->field = &ctx->root;
25347 ctx->fmt_offset = 0;
25348 ctx->head->parent_offset = 0;
25349 ctx->new_packmode =
'@';
25350 ctx->enc_packmode =
'@';
25351 ctx->new_count = 1;
25352 ctx->enc_count = 0;
25354 ctx->is_complex = 0;
25355 ctx->is_valid_array = 0;
25356 ctx->struct_alignment = 0;
25357 while (type->typegroup ==
'S') {
25359 ctx->head->field = type->fields;
25360 ctx->head->parent_offset = 0;
25361 type = type->fields->type;
25364 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
25366 const char* t = *ts;
25367 if (*t < '0' || *t >
'9') {
25370 count = *t++ -
'0';
25371 while (*t >=
'0' && *t <=
'9') {
25373 count += *t++ -
'0';
25379 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
25380 int number = __Pyx_BufFmt_ParseNumber(ts);
25382 PyErr_Format(PyExc_ValueError,\
25383 "Does not understand character buffer dtype format string ('%c')", **ts);
25386 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
25387 PyErr_Format(PyExc_ValueError,
25388 "Unexpected format string character: '%c'", ch);
25390 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
25392 case '?':
return "'bool'";
25393 case 'c':
return "'char'";
25394 case 'b':
return "'signed char'";
25395 case 'B':
return "'unsigned char'";
25396 case 'h':
return "'short'";
25397 case 'H':
return "'unsigned short'";
25398 case 'i':
return "'int'";
25399 case 'I':
return "'unsigned int'";
25400 case 'l':
return "'long'";
25401 case 'L':
return "'unsigned long'";
25402 case 'q':
return "'long long'";
25403 case 'Q':
return "'unsigned long long'";
25404 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
25405 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
25406 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
25407 case 'T':
return "a struct";
25408 case 'O':
return "Python object";
25409 case 'P':
return "a pointer";
25410 case 's':
case 'p':
return "a string";
25411 case 0:
return "end";
25412 default:
return "unparseable format string";
25415 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
25417 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
25418 case 'h':
case 'H':
return 2;
25419 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
25420 case 'q':
case 'Q':
return 8;
25421 case 'f':
return (is_complex ? 8 : 4);
25422 case 'd':
return (is_complex ? 16 : 8);
25424 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
25427 case 'O':
case 'P':
return sizeof(
void*);
25429 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25433 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
25435 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
25436 case 'h':
case 'H':
return sizeof(short);
25437 case 'i':
case 'I':
return sizeof(int);
25438 case 'l':
case 'L':
return sizeof(long);
25439 #ifdef HAVE_LONG_LONG 25440 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
25442 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
25443 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
25444 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
25445 case 'O':
case 'P':
return sizeof(
void*);
25447 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25452 typedef struct {
char c;
short x; } __Pyx_st_short;
25453 typedef struct {
char c;
int x; } __Pyx_st_int;
25454 typedef struct {
char c;
long x; } __Pyx_st_long;
25455 typedef struct {
char c;
float x; } __Pyx_st_float;
25456 typedef struct {
char c;
double x; } __Pyx_st_double;
25457 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
25458 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
25459 #ifdef HAVE_LONG_LONG 25460 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
25462 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
25464 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
25465 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
25466 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
25467 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
25468 #ifdef HAVE_LONG_LONG 25469 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
25471 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
25472 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
25473 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
25474 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
25476 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25484 typedef struct {
short x;
char c; } __Pyx_pad_short;
25485 typedef struct {
int x;
char c; } __Pyx_pad_int;
25486 typedef struct {
long x;
char c; } __Pyx_pad_long;
25487 typedef struct {
float x;
char c; } __Pyx_pad_float;
25488 typedef struct {
double x;
char c; } __Pyx_pad_double;
25489 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
25490 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
25491 #ifdef HAVE_LONG_LONG 25492 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
25494 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
25496 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
25497 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
25498 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
25499 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
25500 #ifdef HAVE_LONG_LONG 25501 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
25503 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
25504 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
25505 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
25506 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
25508 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25512 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
25516 case 'b':
case 'h':
case 'i':
25517 case 'l':
case 'q':
case 's':
case 'p':
25519 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
25521 case 'f':
case 'd':
case 'g':
25522 return (is_complex ?
'C' :
'R');
25528 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25533 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
25534 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
25535 const char* expected;
25537 if (ctx->head == NULL) {
25541 expected = ctx->head->field->type->name;
25544 PyErr_Format(PyExc_ValueError,
25545 "Buffer dtype mismatch, expected %s%s%s but got %s",
25546 quote, expected, quote,
25547 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
25549 __Pyx_StructField* field = ctx->head->field;
25550 __Pyx_StructField* parent = (ctx->head - 1)->field;
25551 PyErr_Format(PyExc_ValueError,
25552 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
25553 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
25554 parent->type->name, field->name);
25557 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
25559 size_t size, offset, arraysize = 1;
25560 if (ctx->enc_type == 0)
return 0;
25561 if (ctx->head->field->type->arraysize[0]) {
25563 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
25564 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
25566 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
25567 PyErr_Format(PyExc_ValueError,
25568 "Expected a dimension of size %zu, got %zu",
25569 ctx->head->field->type->arraysize[0], ctx->enc_count);
25573 if (!ctx->is_valid_array) {
25574 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
25575 ctx->head->field->type->ndim, ndim);
25578 for (i = 0; i < ctx->head->field->type->ndim; i++) {
25579 arraysize *= ctx->head->field->type->arraysize[i];
25581 ctx->is_valid_array = 0;
25582 ctx->enc_count = 1;
25584 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
25586 __Pyx_StructField* field = ctx->head->field;
25587 __Pyx_TypeInfo* type = field->type;
25588 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
25589 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
25591 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
25593 if (ctx->enc_packmode ==
'@') {
25594 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
25595 size_t align_mod_offset;
25596 if (align_at == 0)
return -1;
25597 align_mod_offset = ctx->fmt_offset % align_at;
25598 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
25599 if (ctx->struct_alignment == 0)
25600 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
25603 if (type->size != size || type->typegroup != group) {
25604 if (type->typegroup ==
'C' && type->fields != NULL) {
25605 size_t parent_offset = ctx->head->parent_offset + field->offset;
25607 ctx->head->field = type->fields;
25608 ctx->head->parent_offset = parent_offset;
25611 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
25613 __Pyx_BufFmt_RaiseExpected(ctx);
25617 offset = ctx->head->parent_offset + field->offset;
25618 if (ctx->fmt_offset != offset) {
25619 PyErr_Format(PyExc_ValueError,
25620 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
25621 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
25624 ctx->fmt_offset += size;
25626 ctx->fmt_offset += (arraysize - 1) * size;
25629 if (field == &ctx->root) {
25631 if (ctx->enc_count != 0) {
25632 __Pyx_BufFmt_RaiseExpected(ctx);
25637 ctx->head->field = ++field;
25638 if (field->type == NULL) {
25640 field = ctx->head->field;
25642 }
else if (field->type->typegroup ==
'S') {
25643 size_t parent_offset = ctx->head->parent_offset + field->offset;
25644 if (field->type->fields->type == NULL)
continue;
25645 field = field->type->fields;
25647 ctx->head->field = field;
25648 ctx->head->parent_offset = parent_offset;
25654 }
while (ctx->enc_count);
25656 ctx->is_complex = 0;
25660 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
25662 const char *ts = *tsp;
25664 int ndim = ctx->head->field->type->ndim;
25667 if (ctx->new_count != 1) {
25668 PyErr_SetString(PyExc_ValueError,
25669 "Cannot handle repeated arrays in format string");
25672 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
25673 while (*ts && *ts !=
')') {
25675 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
25678 number = __Pyx_BufFmt_ExpectNumber(&ts);
25679 if (
number == -1)
return NULL;
25680 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i])
25681 return PyErr_Format(PyExc_ValueError,
25682 "Expected a dimension of size %zu, got %d",
25683 ctx->head->field->type->arraysize[i],
number);
25684 if (*ts !=
',' && *ts !=
')')
25685 return PyErr_Format(PyExc_ValueError,
25686 "Expected a comma in format string, got '%c'", *ts);
25687 if (*ts ==
',') ts++;
25691 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
25692 ctx->head->field->type->ndim, i);
25694 PyErr_SetString(PyExc_ValueError,
25695 "Unexpected end of format string, expected ')'");
25698 ctx->is_valid_array = 1;
25699 ctx->new_count = 1;
25703 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
25708 if (ctx->enc_type != 0 && ctx->head == NULL) {
25709 __Pyx_BufFmt_RaiseExpected(ctx);
25712 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
25713 if (ctx->head != NULL) {
25714 __Pyx_BufFmt_RaiseExpected(ctx);
25724 if (!__Pyx_Is_Little_Endian()) {
25725 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
25728 ctx->new_packmode =
'=';
25733 if (__Pyx_Is_Little_Endian()) {
25734 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
25737 ctx->new_packmode =
'=';
25743 ctx->new_packmode = *ts++;
25747 const char* ts_after_sub;
25748 size_t i, struct_count = ctx->new_count;
25749 size_t struct_alignment = ctx->struct_alignment;
25750 ctx->new_count = 1;
25753 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
25756 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
25758 ctx->enc_count = 0;
25759 ctx->struct_alignment = 0;
25762 for (i = 0; i != struct_count; ++i) {
25763 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
25764 if (!ts_after_sub)
return NULL;
25767 if (struct_alignment) ctx->struct_alignment = struct_alignment;
25772 size_t alignment = ctx->struct_alignment;
25774 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
25776 if (alignment && ctx->fmt_offset % alignment) {
25777 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
25782 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
25783 ctx->fmt_offset += ctx->new_count;
25784 ctx->new_count = 1;
25785 ctx->enc_count = 0;
25787 ctx->enc_packmode = ctx->new_packmode;
25793 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
25794 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
25797 CYTHON_FALLTHROUGH;
25798 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
25799 case 'l':
case 'L':
case 'q':
case 'Q':
25800 case 'f':
case 'd':
case 'g':
25801 case 'O':
case 'p':
25802 if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
25803 ctx->enc_packmode == ctx->new_packmode) {
25804 ctx->enc_count += ctx->new_count;
25805 ctx->new_count = 1;
25810 CYTHON_FALLTHROUGH;
25812 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
25813 ctx->enc_count = ctx->new_count;
25814 ctx->enc_packmode = ctx->new_packmode;
25815 ctx->enc_type = *ts;
25816 ctx->is_complex = got_Z;
25818 ctx->new_count = 1;
25823 while(*ts !=
':') ++ts;
25827 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
25831 int number = __Pyx_BufFmt_ExpectNumber(&ts);
25832 if (number == -1)
return NULL;
25833 ctx->new_count = (size_t)number;
25840 static CYTHON_INLINE
void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
25841 if (unlikely(info->buf == NULL))
return;
25842 if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
25843 __Pyx_ReleaseBuffer(info);
25845 static void __Pyx_ZeroBuffer(Py_buffer* buf) {
25848 buf->strides = __Pyx_zeros;
25849 buf->shape = __Pyx_zeros;
25850 buf->suboffsets = __Pyx_minusones;
25852 static int __Pyx__GetBufferAndValidate(
25853 Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype,
int flags,
25854 int nd,
int cast, __Pyx_BufFmt_StackElem* stack)
25857 if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
25858 __Pyx_ZeroBuffer(buf);
25861 if (unlikely(buf->ndim != nd)) {
25862 PyErr_Format(PyExc_ValueError,
25863 "Buffer has wrong number of dimensions (expected %d, got %d)",
25868 __Pyx_BufFmt_Context ctx;
25869 __Pyx_BufFmt_Init(&ctx, stack, dtype);
25870 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format))
goto fail;
25872 if (unlikely((
size_t)buf->itemsize != dtype->size)) {
25873 PyErr_Format(PyExc_ValueError,
25874 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"d byte%s)",
25875 buf->itemsize, (buf->itemsize > 1) ?
"s" :
"",
25876 dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ?
"s" :
"");
25879 if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
25882 __Pyx_SafeReleaseBuffer(buf);
25887 static void __Pyx_RaiseBufferIndexError(
int axis) {
25888 PyErr_Format(PyExc_IndexError,
25889 "Out of bounds on buffer access (axis %d)", axis);
25893 #if CYTHON_FAST_THREAD_STATE 25894 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25895 PyObject *tmp_type, *tmp_value, *tmp_tb;
25896 tmp_type = tstate->curexc_type;
25897 tmp_value = tstate->curexc_value;
25898 tmp_tb = tstate->curexc_traceback;
25899 tstate->curexc_type = type;
25900 tstate->curexc_value = value;
25901 tstate->curexc_traceback = tb;
25902 Py_XDECREF(tmp_type);
25903 Py_XDECREF(tmp_value);
25904 Py_XDECREF(tmp_tb);
25906 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25907 *type = tstate->curexc_type;
25908 *value = tstate->curexc_value;
25909 *tb = tstate->curexc_traceback;
25910 tstate->curexc_type = 0;
25911 tstate->curexc_value = 0;
25912 tstate->curexc_traceback = 0;
25917 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY 25918 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
25920 value = PyDict_GetItemWithError(d, key);
25921 if (unlikely(!value)) {
25922 if (!PyErr_Occurred()) {
25923 if (unlikely(PyTuple_Check(key))) {
25924 PyObject* args = PyTuple_Pack(1, key);
25925 if (likely(args)) {
25926 PyErr_SetObject(PyExc_KeyError, args);
25930 PyErr_SetObject(PyExc_KeyError, key);
25941 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
25943 if (!j)
return NULL;
25944 r = PyObject_GetItem(o, j);
25948 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
25949 CYTHON_NCP_UNUSED
int wraparound,
25950 CYTHON_NCP_UNUSED
int boundscheck) {
25951 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 25952 Py_ssize_t wrapped_i = i;
25953 if (wraparound & unlikely(i < 0)) {
25954 wrapped_i += PyList_GET_SIZE(o);
25956 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
25957 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
25961 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25963 return PySequence_GetItem(o, i);
25966 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
25967 CYTHON_NCP_UNUSED
int wraparound,
25968 CYTHON_NCP_UNUSED
int boundscheck) {
25969 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 25970 Py_ssize_t wrapped_i = i;
25971 if (wraparound & unlikely(i < 0)) {
25972 wrapped_i += PyTuple_GET_SIZE(o);
25974 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
25975 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
25979 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25981 return PySequence_GetItem(o, i);
25984 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
25985 CYTHON_NCP_UNUSED
int wraparound,
25986 CYTHON_NCP_UNUSED
int boundscheck) {
25987 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS 25988 if (is_list || PyList_CheckExact(o)) {
25989 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
25990 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
25991 PyObject *
r = PyList_GET_ITEM(o, n);
25996 else if (PyTuple_CheckExact(o)) {
25997 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
25998 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
25999 PyObject *
r = PyTuple_GET_ITEM(o, n);
26004 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
26005 if (likely(m && m->sq_item)) {
26006 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
26007 Py_ssize_t l = m->sq_length(o);
26008 if (likely(l >= 0)) {
26011 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
26016 return m->sq_item(o, i);
26020 if (is_list || PySequence_Check(o)) {
26021 return PySequence_GetItem(o, i);
26024 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
26028 #if CYTHON_USE_TYPE_SLOTS 26029 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
26031 Py_ssize_t key_value;
26032 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
26033 if (unlikely(!(m && m->sq_item))) {
26034 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
26037 key_value = __Pyx_PyIndex_AsSsize_t(index);
26038 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
26039 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
26041 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
26043 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
26047 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
26048 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
26049 if (likely(m && m->mp_subscript)) {
26050 return m->mp_subscript(obj, key);
26052 return __Pyx_PyObject_GetIndex(obj, key);
26057 #if !CYTHON_COMPILING_IN_PYPY 26058 static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check) {
26059 const double b = floatval;
26062 (void)zerodivision_check;
26063 if (likely(PyFloat_CheckExact(op1))) {
26064 a = PyFloat_AS_DOUBLE(op1);
26067 #if PY_MAJOR_VERSION < 3 26068 if (likely(PyInt_CheckExact(op1))) {
26069 a = (double) PyInt_AS_LONG(op1);
26073 if (likely(PyLong_CheckExact(op1))) {
26074 #if CYTHON_USE_PYLONG_INTERNALS 26075 const digit* digits = ((PyLongObject*)op1)->ob_digit;
26076 const Py_ssize_t size = Py_SIZE(op1);
26078 case 0: a = 0.0;
break;
26079 case -1: a = -(double) digits[0];
break;
26080 case 1: a = (double) digits[0];
break;
26083 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
26084 a = (double) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26085 if ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
26091 CYTHON_FALLTHROUGH;
26094 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
26095 a = (double) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26096 if ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
26102 CYTHON_FALLTHROUGH;
26105 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
26106 a = (double) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26107 if ((8 *
sizeof(
unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
26113 CYTHON_FALLTHROUGH;
26118 a = PyLong_AsDouble(op1);
26119 if (unlikely(a == -1.0 && PyErr_Occurred()))
return NULL;
26123 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
26126 PyFPE_START_PROTECT(
"add",
return NULL)
26128 PyFPE_END_PROTECT(result)
26129 return PyFloat_FromDouble(result);
26134 #if CYTHON_FAST_PYCALL 26135 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
26136 PyObject *globals) {
26138 PyThreadState *tstate = __Pyx_PyThreadState_Current;
26139 PyObject **fastlocals;
26142 assert(globals != NULL);
26147 assert(tstate != NULL);
26148 f = PyFrame_New(tstate, co, globals, NULL);
26152 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
26153 for (i = 0; i < na; i++) {
26155 fastlocals[i] = *args++;
26157 result = PyEval_EvalFrameEx(f,0);
26158 ++tstate->recursion_depth;
26160 --tstate->recursion_depth;
26163 #if 1 || PY_VERSION_HEX < 0x030600B1 26164 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
26165 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
26166 PyObject *globals = PyFunction_GET_GLOBALS(func);
26167 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
26169 #if PY_MAJOR_VERSION >= 3 26172 PyObject *kwtuple, **k;
26177 assert(kwargs == NULL || PyDict_Check(kwargs));
26178 nk = kwargs ? PyDict_Size(kwargs) : 0;
26179 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
26183 #
if PY_MAJOR_VERSION >= 3
26184 co->co_kwonlyargcount == 0 &&
26186 likely(kwargs == NULL || nk == 0) &&
26187 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
26188 if (argdefs == NULL && co->co_argcount == nargs) {
26189 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
26192 else if (nargs == 0 && argdefs != NULL
26193 && co->co_argcount == Py_SIZE(argdefs)) {
26196 args = &PyTuple_GET_ITEM(argdefs, 0);
26197 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
26201 if (kwargs != NULL) {
26203 kwtuple = PyTuple_New(2 * nk);
26204 if (kwtuple == NULL) {
26208 k = &PyTuple_GET_ITEM(kwtuple, 0);
26210 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
26221 closure = PyFunction_GET_CLOSURE(func);
26222 #if PY_MAJOR_VERSION >= 3 26223 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
26225 if (argdefs != NULL) {
26226 d = &PyTuple_GET_ITEM(argdefs, 0);
26227 nd = Py_SIZE(argdefs);
26233 #if PY_MAJOR_VERSION >= 3 26234 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
26237 d, (
int)nd, kwdefs, closure);
26239 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
26242 d, (
int)nd, closure);
26244 Py_XDECREF(kwtuple);
26246 Py_LeaveRecursiveCall();
26253 #if CYTHON_FAST_PYCCALL 26254 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
26255 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
26256 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
26257 PyObject *
self = PyCFunction_GET_SELF(func);
26258 int flags = PyCFunction_GET_FLAGS(func);
26259 assert(PyCFunction_Check(func));
26260 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
26261 assert(nargs >= 0);
26262 assert(nargs == 0 || args != NULL);
26266 assert(!PyErr_Occurred());
26267 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
26268 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
26270 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
26276 #if CYTHON_COMPILING_IN_CPYTHON 26277 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26279 ternaryfunc call = func->ob_type->tp_call;
26280 if (unlikely(!call))
26281 return PyObject_Call(func, arg, kw);
26282 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
26284 result = (*call)(func, arg, kw);
26285 Py_LeaveRecursiveCall();
26286 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
26289 "NULL result without error in PyObject_Call");
26296 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS 26297 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
26298 PyObject *dict = Py_TYPE(obj)->tp_dict;
26299 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
26301 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
26302 PyObject **dictptr = NULL;
26303 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
26305 #if CYTHON_COMPILING_IN_CPYTHON 26306 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
26308 dictptr = _PyObject_GetDictPtr(obj);
26311 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
26313 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
26314 PyObject *dict = Py_TYPE(obj)->tp_dict;
26315 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
26317 return obj_dict_version == __Pyx_get_object_dict_version(obj);
26322 #if CYTHON_USE_DICT_VERSIONS 26323 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
26325 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
26329 #if !CYTHON_AVOID_BORROWED_REFS 26330 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 26331 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
26332 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
26333 if (likely(result)) {
26334 return __Pyx_NewRef(result);
26335 }
else if (unlikely(PyErr_Occurred())) {
26339 result = PyDict_GetItem(__pyx_d, name);
26340 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
26341 if (likely(result)) {
26342 return __Pyx_NewRef(result);
26346 result = PyObject_GetItem(__pyx_d, name);
26347 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
26348 if (likely(result)) {
26349 return __Pyx_NewRef(result);
26353 return __Pyx_GetBuiltinName(name);
26357 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
26358 if (unlikely(!type)) {
26359 PyErr_SetString(PyExc_SystemError,
"Missing type object");
26362 if (likely(__Pyx_TypeCheck(obj, type)))
26364 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
26365 Py_TYPE(obj)->tp_name, type->tp_name);
26370 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
26371 PyObject *args, *result = NULL;
26372 #if CYTHON_FAST_PYCALL 26373 if (PyFunction_Check(
function)) {
26374 PyObject *args[2] = {arg1, arg2};
26375 return __Pyx_PyFunction_FastCall(
function, args, 2);
26378 #if CYTHON_FAST_PYCCALL 26379 if (__Pyx_PyFastCFunction_Check(
function)) {
26380 PyObject *args[2] = {arg1, arg2};
26381 return __Pyx_PyCFunction_FastCall(
function, args, 2);
26384 args = PyTuple_New(2);
26385 if (unlikely(!args))
goto done;
26387 PyTuple_SET_ITEM(args, 0, arg1);
26389 PyTuple_SET_ITEM(args, 1, arg2);
26390 Py_INCREF(
function);
26391 result = __Pyx_PyObject_Call(
function, args, NULL);
26393 Py_DECREF(
function);
26399 #if CYTHON_COMPILING_IN_CPYTHON 26400 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
26401 PyObject *
self, *result;
26403 cfunc = PyCFunction_GET_FUNCTION(func);
26404 self = PyCFunction_GET_SELF(func);
26405 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
26407 result = cfunc(
self, arg);
26408 Py_LeaveRecursiveCall();
26409 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
26412 "NULL result without error in PyObject_Call");
26419 #if CYTHON_COMPILING_IN_CPYTHON 26420 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
26422 PyObject *args = PyTuple_New(1);
26423 if (unlikely(!args))
return NULL;
26425 PyTuple_SET_ITEM(args, 0, arg);
26426 result = __Pyx_PyObject_Call(func, args, NULL);
26430 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
26431 #if CYTHON_FAST_PYCALL 26432 if (PyFunction_Check(func)) {
26433 return __Pyx_PyFunction_FastCall(func, &arg, 1);
26436 if (likely(PyCFunction_Check(func))) {
26437 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
26438 return __Pyx_PyObject_CallMethO(func, arg);
26439 #if CYTHON_FAST_PYCCALL 26440 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
26441 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
26445 return __Pyx__PyObject_CallOneArg(func, arg);
26448 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
26450 PyObject *args = PyTuple_Pack(1, arg);
26451 if (unlikely(!args))
return NULL;
26452 result = __Pyx_PyObject_Call(func, args, NULL);
26459 static double __Pyx__PyObject_AsDouble(PyObject* obj) {
26460 PyObject* float_value;
26461 #if !CYTHON_USE_TYPE_SLOTS 26462 float_value = PyNumber_Float(obj);
if ((0))
goto bad;
26464 PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
26465 if (likely(nb) && likely(nb->nb_float)) {
26466 float_value = nb->nb_float(obj);
26467 if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
26468 PyErr_Format(PyExc_TypeError,
26469 "__float__ returned non-float (type %.200s)",
26470 Py_TYPE(float_value)->tp_name);
26471 Py_DECREF(float_value);
26474 }
else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
26475 #if PY_MAJOR_VERSION >= 3 26476 float_value = PyFloat_FromString(obj);
26478 float_value = PyFloat_FromString(obj, 0);
26481 PyObject* args = PyTuple_New(1);
26482 if (unlikely(!args))
goto bad;
26483 PyTuple_SET_ITEM(args, 0, obj);
26484 float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
26485 PyTuple_SET_ITEM(args, 0, 0);
26489 if (likely(float_value)) {
26490 double value = PyFloat_AS_DOUBLE(float_value);
26491 Py_DECREF(float_value);
26499 #if PY_MAJOR_VERSION < 3 26500 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
26501 CYTHON_UNUSED PyObject *cause) {
26502 __Pyx_PyThreadState_declare
26504 if (!value || value == Py_None)
26508 if (!tb || tb == Py_None)
26512 if (!PyTraceBack_Check(tb)) {
26513 PyErr_SetString(PyExc_TypeError,
26514 "raise: arg 3 must be a traceback or None");
26518 if (PyType_Check(type)) {
26519 #if CYTHON_COMPILING_IN_PYPY 26521 Py_INCREF(Py_None);
26525 PyErr_NormalizeException(&type, &value, &tb);
26528 PyErr_SetString(PyExc_TypeError,
26529 "instance exception may not have a separate value");
26533 type = (PyObject*) Py_TYPE(type);
26535 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
26536 PyErr_SetString(PyExc_TypeError,
26537 "raise: exception class must be a subclass of BaseException");
26541 __Pyx_PyThreadState_assign
26542 __Pyx_ErrRestore(type, value, tb);
26551 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
26552 PyObject* owned_instance = NULL;
26553 if (tb == Py_None) {
26555 }
else if (tb && !PyTraceBack_Check(tb)) {
26556 PyErr_SetString(PyExc_TypeError,
26557 "raise: arg 3 must be a traceback or None");
26560 if (value == Py_None)
26562 if (PyExceptionInstance_Check(type)) {
26564 PyErr_SetString(PyExc_TypeError,
26565 "instance exception may not have a separate value");
26569 type = (PyObject*) Py_TYPE(value);
26570 }
else if (PyExceptionClass_Check(type)) {
26571 PyObject *instance_class = NULL;
26572 if (value && PyExceptionInstance_Check(value)) {
26573 instance_class = (PyObject*) Py_TYPE(value);
26574 if (instance_class != type) {
26575 int is_subclass = PyObject_IsSubclass(instance_class, type);
26576 if (!is_subclass) {
26577 instance_class = NULL;
26578 }
else if (unlikely(is_subclass == -1)) {
26581 type = instance_class;
26585 if (!instance_class) {
26588 args = PyTuple_New(0);
26589 else if (PyTuple_Check(value)) {
26593 args = PyTuple_Pack(1, value);
26596 owned_instance = PyObject_Call(type, args, NULL);
26598 if (!owned_instance)
26600 value = owned_instance;
26601 if (!PyExceptionInstance_Check(value)) {
26602 PyErr_Format(PyExc_TypeError,
26603 "calling %R should have returned an instance of " 26604 "BaseException, not %R",
26605 type, Py_TYPE(value));
26610 PyErr_SetString(PyExc_TypeError,
26611 "raise: exception class must be a subclass of BaseException");
26615 PyObject *fixed_cause;
26616 if (cause == Py_None) {
26617 fixed_cause = NULL;
26618 }
else if (PyExceptionClass_Check(cause)) {
26619 fixed_cause = PyObject_CallObject(cause, NULL);
26620 if (fixed_cause == NULL)
26622 }
else if (PyExceptionInstance_Check(cause)) {
26623 fixed_cause = cause;
26624 Py_INCREF(fixed_cause);
26626 PyErr_SetString(PyExc_TypeError,
26627 "exception causes must derive from " 26631 PyException_SetCause(value, fixed_cause);
26633 PyErr_SetObject(type, value);
26635 #if CYTHON_COMPILING_IN_PYPY 26636 PyObject *tmp_type, *tmp_value, *tmp_tb;
26637 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
26639 PyErr_Restore(tmp_type, tmp_value, tb);
26640 Py_XDECREF(tmp_tb);
26642 PyThreadState *tstate = __Pyx_PyThreadState_Current;
26643 PyObject* tmp_tb = tstate->curexc_traceback;
26644 if (tb != tmp_tb) {
26646 tstate->curexc_traceback = tb;
26647 Py_XDECREF(tmp_tb);
26652 Py_XDECREF(owned_instance);
26658 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
26659 PyErr_Format(PyExc_ValueError,
26660 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
26664 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
26665 PyErr_Format(PyExc_ValueError,
26666 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
26667 index, (index == 1) ?
"" :
"s");
26671 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
26672 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
26676 #if CYTHON_USE_EXC_INFO_STACK 26677 static _PyErr_StackItem *
26678 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
26680 _PyErr_StackItem *exc_info = tstate->exc_info;
26681 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
26682 exc_info->previous_item != NULL)
26684 exc_info = exc_info->previous_item;
26691 #if CYTHON_FAST_THREAD_STATE 26692 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26693 #if CYTHON_USE_EXC_INFO_STACK 26694 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
26695 *type = exc_info->exc_type;
26696 *value = exc_info->exc_value;
26697 *tb = exc_info->exc_traceback;
26699 *type = tstate->exc_type;
26700 *value = tstate->exc_value;
26701 *tb = tstate->exc_traceback;
26704 Py_XINCREF(*value);
26707 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
26708 PyObject *tmp_type, *tmp_value, *tmp_tb;
26709 #if CYTHON_USE_EXC_INFO_STACK 26710 _PyErr_StackItem *exc_info = tstate->exc_info;
26711 tmp_type = exc_info->exc_type;
26712 tmp_value = exc_info->exc_value;
26713 tmp_tb = exc_info->exc_traceback;
26714 exc_info->exc_type = type;
26715 exc_info->exc_value = value;
26716 exc_info->exc_traceback = tb;
26718 tmp_type = tstate->exc_type;
26719 tmp_value = tstate->exc_value;
26720 tmp_tb = tstate->exc_traceback;
26721 tstate->exc_type = type;
26722 tstate->exc_value = value;
26723 tstate->exc_traceback = tb;
26725 Py_XDECREF(tmp_type);
26726 Py_XDECREF(tmp_value);
26727 Py_XDECREF(tmp_tb);
26732 #if CYTHON_FAST_THREAD_STATE 26733 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
26735 n = PyTuple_GET_SIZE(tuple);
26736 #if PY_MAJOR_VERSION >= 3 26737 for (i=0; i<
n; i++) {
26738 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
26741 for (i=0; i<
n; i++) {
26742 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
26746 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
26747 PyObject *exc_type = tstate->curexc_type;
26748 if (exc_type == err)
return 1;
26749 if (unlikely(!exc_type))
return 0;
26750 if (unlikely(PyTuple_Check(err)))
26751 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
26752 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
26757 #if CYTHON_FAST_THREAD_STATE 26758 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
26760 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
26763 PyObject *local_type, *local_value, *local_tb;
26764 #if CYTHON_FAST_THREAD_STATE 26765 PyObject *tmp_type, *tmp_value, *tmp_tb;
26766 local_type = tstate->curexc_type;
26767 local_value = tstate->curexc_value;
26768 local_tb = tstate->curexc_traceback;
26769 tstate->curexc_type = 0;
26770 tstate->curexc_value = 0;
26771 tstate->curexc_traceback = 0;
26773 PyErr_Fetch(&local_type, &local_value, &local_tb);
26775 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
26776 #if CYTHON_FAST_THREAD_STATE 26777 if (unlikely(tstate->curexc_type))
26779 if (unlikely(PyErr_Occurred()))
26782 #if PY_MAJOR_VERSION >= 3 26784 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
26788 Py_XINCREF(local_tb);
26789 Py_XINCREF(local_type);
26790 Py_XINCREF(local_value);
26791 *type = local_type;
26792 *value = local_value;
26794 #if CYTHON_FAST_THREAD_STATE 26795 #if CYTHON_USE_EXC_INFO_STACK 26797 _PyErr_StackItem *exc_info = tstate->exc_info;
26798 tmp_type = exc_info->exc_type;
26799 tmp_value = exc_info->exc_value;
26800 tmp_tb = exc_info->exc_traceback;
26801 exc_info->exc_type = local_type;
26802 exc_info->exc_value = local_value;
26803 exc_info->exc_traceback = local_tb;
26806 tmp_type = tstate->exc_type;
26807 tmp_value = tstate->exc_value;
26808 tmp_tb = tstate->exc_traceback;
26809 tstate->exc_type = local_type;
26810 tstate->exc_value = local_value;
26811 tstate->exc_traceback = local_tb;
26813 Py_XDECREF(tmp_type);
26814 Py_XDECREF(tmp_value);
26815 Py_XDECREF(tmp_tb);
26817 PyErr_SetExcInfo(local_type, local_value, local_tb);
26824 Py_XDECREF(local_type);
26825 Py_XDECREF(local_value);
26826 Py_XDECREF(local_tb);
26831 #ifndef __PYX_HAVE_RT_ImportType 26832 #define __PYX_HAVE_RT_ImportType 26833 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
26834 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
26836 PyObject *result = 0;
26838 Py_ssize_t basicsize;
26839 #ifdef Py_LIMITED_API 26840 PyObject *py_basicsize;
26842 result = PyObject_GetAttrString(module, class_name);
26845 if (!PyType_Check(result)) {
26846 PyErr_Format(PyExc_TypeError,
26847 "%.200s.%.200s is not a type object",
26848 module_name, class_name);
26851 #ifndef Py_LIMITED_API 26852 basicsize = ((PyTypeObject *)result)->tp_basicsize;
26854 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
26857 basicsize = PyLong_AsSsize_t(py_basicsize);
26858 Py_DECREF(py_basicsize);
26860 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
26863 if ((
size_t)basicsize < size) {
26864 PyErr_Format(PyExc_ValueError,
26865 "%.200s.%.200s size changed, may indicate binary incompatibility. " 26866 "Expected %zd from C header, got %zd from PyObject",
26867 module_name, class_name, size, basicsize);
26870 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
26871 PyErr_Format(PyExc_ValueError,
26872 "%.200s.%.200s size changed, may indicate binary incompatibility. " 26873 "Expected %zd from C header, got %zd from PyObject",
26874 module_name, class_name, size, basicsize);
26877 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
26878 PyOS_snprintf(warning,
sizeof(warning),
26879 "%s.%s size changed, may indicate binary incompatibility. " 26880 "Expected %zd from C header, got %zd from PyObject",
26881 module_name, class_name, size, basicsize);
26882 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
26884 return (PyTypeObject *)result;
26886 Py_XDECREF(result);
26892 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
26893 PyObject *empty_list = 0;
26894 PyObject *module = 0;
26895 PyObject *global_dict = 0;
26896 PyObject *empty_dict = 0;
26898 #if PY_MAJOR_VERSION < 3 26899 PyObject *py_import;
26900 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
26907 empty_list = PyList_New(0);
26912 global_dict = PyModule_GetDict(__pyx_m);
26915 empty_dict = PyDict_New();
26919 #if PY_MAJOR_VERSION >= 3 26921 if (strchr(__Pyx_MODULE_NAME,
'.')) {
26922 module = PyImport_ImportModuleLevelObject(
26923 name, global_dict, empty_dict, list, 1);
26925 if (!PyErr_ExceptionMatches(PyExc_ImportError))
26934 #if PY_MAJOR_VERSION < 3 26935 PyObject *py_level = PyInt_FromLong(level);
26938 module = PyObject_CallFunctionObjArgs(py_import,
26939 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
26940 Py_DECREF(py_level);
26942 module = PyImport_ImportModuleLevelObject(
26943 name, global_dict, empty_dict, list, level);
26948 #if PY_MAJOR_VERSION < 3 26949 Py_XDECREF(py_import);
26951 Py_XDECREF(empty_list);
26952 Py_XDECREF(empty_dict);
26957 #ifndef CYTHON_CLINE_IN_TRACEBACK 26958 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
26959 PyObject *use_cline;
26960 PyObject *ptype, *pvalue, *ptraceback;
26961 #if CYTHON_COMPILING_IN_CPYTHON 26962 PyObject **cython_runtime_dict;
26964 if (unlikely(!__pyx_cython_runtime)) {
26967 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26968 #if CYTHON_COMPILING_IN_CPYTHON 26969 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26970 if (likely(cython_runtime_dict)) {
26971 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
26972 use_cline, *cython_runtime_dict,
26973 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
26977 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26978 if (use_cline_obj) {
26979 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26980 Py_DECREF(use_cline_obj);
26988 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26990 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
26993 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26999 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
27000 int start = 0, mid = 0, end = count - 1;
27001 if (end >= 0 && code_line > entries[end].code_line) {
27004 while (start < end) {
27005 mid = start + (end - start) / 2;
27006 if (code_line < entries[mid].code_line) {
27008 }
else if (code_line > entries[mid].code_line) {
27014 if (code_line <= entries[mid].code_line) {
27020 static PyCodeObject *__pyx_find_code_object(
int code_line) {
27021 PyCodeObject* code_object;
27023 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
27026 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27027 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
27030 code_object = __pyx_code_cache.entries[
pos].code_object;
27031 Py_INCREF(code_object);
27032 return code_object;
27034 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
27036 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
27037 if (unlikely(!code_line)) {
27040 if (unlikely(!entries)) {
27041 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
27042 if (likely(entries)) {
27043 __pyx_code_cache.entries = entries;
27044 __pyx_code_cache.max_count = 64;
27045 __pyx_code_cache.count = 1;
27046 entries[0].code_line = code_line;
27047 entries[0].code_object = code_object;
27048 Py_INCREF(code_object);
27052 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27053 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
27054 PyCodeObject* tmp = entries[
pos].code_object;
27055 entries[
pos].code_object = code_object;
27059 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
27060 int new_max = __pyx_code_cache.max_count + 64;
27061 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
27062 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
27063 if (unlikely(!entries)) {
27066 __pyx_code_cache.entries = entries;
27067 __pyx_code_cache.max_count = new_max;
27069 for (i=__pyx_code_cache.count; i>pos; i--) {
27070 entries[i] = entries[i-1];
27072 entries[
pos].code_line = code_line;
27073 entries[
pos].code_object = code_object;
27074 __pyx_code_cache.count++;
27075 Py_INCREF(code_object);
27079 #include "compile.h" 27080 #include "frameobject.h" 27081 #include "traceback.h" 27082 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
27083 const char *funcname,
int c_line,
27084 int py_line,
const char *filename) {
27085 PyCodeObject *py_code = 0;
27086 PyObject *py_srcfile = 0;
27087 PyObject *py_funcname = 0;
27088 #if PY_MAJOR_VERSION < 3 27089 py_srcfile = PyString_FromString(filename);
27091 py_srcfile = PyUnicode_FromString(filename);
27093 if (!py_srcfile)
goto bad;
27095 #if PY_MAJOR_VERSION < 3 27096 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27098 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27102 #if PY_MAJOR_VERSION < 3 27103 py_funcname = PyString_FromString(funcname);
27105 py_funcname = PyUnicode_FromString(funcname);
27108 if (!py_funcname)
goto bad;
27109 py_code = __Pyx_PyCode_New(
27126 Py_DECREF(py_srcfile);
27127 Py_DECREF(py_funcname);
27130 Py_XDECREF(py_srcfile);
27131 Py_XDECREF(py_funcname);
27134 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
27135 int py_line,
const char *filename) {
27136 PyCodeObject *py_code = 0;
27137 PyFrameObject *py_frame = 0;
27138 PyThreadState *tstate = __Pyx_PyThreadState_Current;
27140 c_line = __Pyx_CLineForTraceback(tstate, c_line);
27142 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
27144 py_code = __Pyx_CreateCodeObjectForTraceback(
27145 funcname, c_line, py_line, filename);
27146 if (!py_code)
goto bad;
27147 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
27149 py_frame = PyFrame_New(
27155 if (!py_frame)
goto bad;
27156 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
27157 PyTraceBack_Here(py_frame);
27159 Py_XDECREF(py_code);
27160 Py_XDECREF(py_frame);
27163 #if PY_MAJOR_VERSION < 3 27164 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
27165 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
27166 if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray))
return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
27167 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
27170 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
27171 PyObject *obj = view->obj;
27173 if (PyObject_CheckBuffer(obj)) {
27174 PyBuffer_Release(view);
27178 else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
27186 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ 27187 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) 27188 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ 27189 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) 27190 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ 27192 func_type value = func_value;\ 27193 if (sizeof(target_type) < sizeof(func_type)) {\ 27194 if (unlikely(value != (func_type) (target_type) value)) {\ 27195 func_type zero = 0;\ 27196 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ 27197 return (target_type) -1;\ 27198 if (is_unsigned && unlikely(value < zero))\ 27199 goto raise_neg_overflow;\ 27201 goto raise_overflow;\ 27204 return (target_type) value;\ 27208 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
27209 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
27210 const int is_unsigned = neg_one > const_zero;
27212 if (
sizeof(
int) <
sizeof(long)) {
27213 return PyInt_FromLong((
long) value);
27214 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27215 return PyLong_FromUnsignedLong((
unsigned long) value);
27216 #ifdef HAVE_LONG_LONG 27217 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27218 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27222 if (
sizeof(
int) <=
sizeof(
long)) {
27223 return PyInt_FromLong((
long) value);
27224 #ifdef HAVE_LONG_LONG 27225 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
27226 return PyLong_FromLongLong((PY_LONG_LONG) value);
27231 int one = 1;
int little = (int)*(
unsigned char *)&one;
27232 unsigned char *bytes = (
unsigned char *)&value;
27233 return _PyLong_FromByteArray(bytes,
sizeof(
int),
27234 little, !is_unsigned);
27239 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
27240 const Py_intptr_t neg_one = (Py_intptr_t) ((Py_intptr_t) 0 - (Py_intptr_t) 1), const_zero = (Py_intptr_t) 0;
27241 const int is_unsigned = neg_one > const_zero;
27243 if (
sizeof(Py_intptr_t) <
sizeof(long)) {
27244 return PyInt_FromLong((
long) value);
27245 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned long)) {
27246 return PyLong_FromUnsignedLong((
unsigned long) value);
27247 #ifdef HAVE_LONG_LONG 27248 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned PY_LONG_LONG)) {
27249 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27253 if (
sizeof(Py_intptr_t) <=
sizeof(
long)) {
27254 return PyInt_FromLong((
long) value);
27255 #ifdef HAVE_LONG_LONG 27256 }
else if (
sizeof(Py_intptr_t) <=
sizeof(PY_LONG_LONG)) {
27257 return PyLong_FromLongLong((PY_LONG_LONG) value);
27262 int one = 1;
int little = (int)*(
unsigned char *)&one;
27263 unsigned char *bytes = (
unsigned char *)&value;
27264 return _PyLong_FromByteArray(bytes,
sizeof(Py_intptr_t),
27265 little, !is_unsigned);
27270 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
27271 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
27272 const int is_unsigned = neg_one > const_zero;
27274 if (
sizeof(
long) <
sizeof(long)) {
27275 return PyInt_FromLong((
long) value);
27276 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
27277 return PyLong_FromUnsignedLong((
unsigned long) value);
27278 #ifdef HAVE_LONG_LONG 27279 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
27280 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27284 if (
sizeof(
long) <=
sizeof(
long)) {
27285 return PyInt_FromLong((
long) value);
27286 #ifdef HAVE_LONG_LONG 27287 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
27288 return PyLong_FromLongLong((PY_LONG_LONG) value);
27293 int one = 1;
int little = (int)*(
unsigned char *)&one;
27294 unsigned char *bytes = (
unsigned char *)&value;
27295 return _PyLong_FromByteArray(bytes,
sizeof(
long),
27296 little, !is_unsigned);
27301 #if CYTHON_CCOMPLEX 27303 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27304 return ::std::complex< float >(x, y);
27307 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27308 return x + y*(__pyx_t_float_complex)_Complex_I;
27312 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27313 __pyx_t_float_complex
z;
27321 #if CYTHON_CCOMPLEX 27323 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27324 return (a.real == b.real) && (a.imag == b.imag);
27326 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27327 __pyx_t_float_complex
z;
27328 z.real = a.real + b.real;
27329 z.imag = a.imag + b.imag;
27332 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27333 __pyx_t_float_complex
z;
27334 z.real = a.real - b.real;
27335 z.imag = a.imag - b.imag;
27338 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27339 __pyx_t_float_complex
z;
27340 z.real = a.real * b.real - a.imag * b.imag;
27341 z.imag = a.real * b.imag + a.imag * b.real;
27345 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27347 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27348 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
27349 if (b.real == 0 && b.imag == 0) {
27350 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
27352 float r = b.imag / b.real;
27353 float s = (float)(1.0) / (b.real + b.imag *
r);
27354 return __pyx_t_float_complex_from_parts(
27355 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27358 float r = b.real / b.imag;
27359 float s = (float)(1.0) / (b.imag + b.real *
r);
27360 return __pyx_t_float_complex_from_parts(
27361 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27365 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27367 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27369 float denom = b.real * b.real + b.imag * b.imag;
27370 return __pyx_t_float_complex_from_parts(
27371 (a.real * b.real + a.imag * b.imag) / denom,
27372 (a.imag * b.real - a.real * b.imag) / denom);
27376 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
27377 __pyx_t_float_complex
z;
27382 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
27383 return (a.real == 0) && (a.imag == 0);
27385 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
27386 __pyx_t_float_complex
z;
27392 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
27393 #if !defined(HAVE_HYPOT) || defined(_MSC_VER) 27394 return sqrtf(z.real*z.real + z.imag*z.imag);
27396 return hypotf(z.real, z.imag);
27399 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27400 __pyx_t_float_complex
z;
27401 float r, lnr, theta, z_r, z_theta;
27402 if (b.imag == 0 && b.real == (
int)b.real) {
27404 float denom = a.real * a.real + a.imag * a.imag;
27405 a.real = a.real / denom;
27406 a.imag = -a.imag / denom;
27409 switch ((
int)b.real) {
27417 return __Pyx_c_prod_float(a, a);
27419 z = __Pyx_c_prod_float(a, a);
27420 return __Pyx_c_prod_float(z, a);
27422 z = __Pyx_c_prod_float(a, a);
27423 return __Pyx_c_prod_float(z, z);
27429 }
else if (b.imag == 0) {
27430 z.real = powf(a.real, b.real);
27433 }
else if (a.real > 0) {
27438 theta = atan2f(0.0, -1.0);
27441 r = __Pyx_c_abs_float(a);
27442 theta = atan2f(a.imag, a.real);
27445 z_r = expf(lnr * b.real - theta * b.imag);
27446 z_theta = theta * b.real + lnr * b.imag;
27447 z.real = z_r * cosf(z_theta);
27448 z.imag = z_r * sinf(z_theta);
27455 #if CYTHON_CCOMPLEX 27457 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27458 return ::std::complex< double >(x, y);
27461 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27462 return x + y*(__pyx_t_double_complex)_Complex_I;
27466 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27467 __pyx_t_double_complex
z;
27475 #if CYTHON_CCOMPLEX 27477 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27478 return (a.real == b.real) && (a.imag == b.imag);
27480 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27481 __pyx_t_double_complex
z;
27482 z.real = a.real + b.real;
27483 z.imag = a.imag + b.imag;
27486 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27487 __pyx_t_double_complex
z;
27488 z.real = a.real - b.real;
27489 z.imag = a.imag - b.imag;
27492 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27493 __pyx_t_double_complex
z;
27494 z.real = a.real * b.real - a.imag * b.imag;
27495 z.imag = a.real * b.imag + a.imag * b.real;
27499 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27501 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27502 }
else if (fabs(b.real) >= fabs(b.imag)) {
27503 if (b.real == 0 && b.imag == 0) {
27504 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
27506 double r = b.imag / b.real;
27507 double s = (double)(1.0) / (b.real + b.imag *
r);
27508 return __pyx_t_double_complex_from_parts(
27509 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27512 double r = b.real / b.imag;
27513 double s = (double)(1.0) / (b.imag + b.real *
r);
27514 return __pyx_t_double_complex_from_parts(
27515 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27519 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27521 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27523 double denom = b.real * b.real + b.imag * b.imag;
27524 return __pyx_t_double_complex_from_parts(
27525 (a.real * b.real + a.imag * b.imag) / denom,
27526 (a.imag * b.real - a.real * b.imag) / denom);
27530 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
27531 __pyx_t_double_complex
z;
27536 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
27537 return (a.real == 0) && (a.imag == 0);
27539 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
27540 __pyx_t_double_complex
z;
27546 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex z) {
27547 #if !defined(HAVE_HYPOT) || defined(_MSC_VER) 27548 return sqrt(z.real*z.real + z.imag*z.imag);
27550 return hypot(z.real, z.imag);
27553 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27554 __pyx_t_double_complex
z;
27555 double r, lnr, theta, z_r, z_theta;
27556 if (b.imag == 0 && b.real == (
int)b.real) {
27558 double denom = a.real * a.real + a.imag * a.imag;
27559 a.real = a.real / denom;
27560 a.imag = -a.imag / denom;
27563 switch ((
int)b.real) {
27571 return __Pyx_c_prod_double(a, a);
27573 z = __Pyx_c_prod_double(a, a);
27574 return __Pyx_c_prod_double(z, a);
27576 z = __Pyx_c_prod_double(a, a);
27577 return __Pyx_c_prod_double(z, z);
27583 }
else if (b.imag == 0) {
27584 z.real = pow(a.real, b.real);
27587 }
else if (a.real > 0) {
27592 theta = atan2(0.0, -1.0);
27595 r = __Pyx_c_abs_double(a);
27596 theta = atan2(a.imag, a.real);
27599 z_r = exp(lnr * b.real - theta * b.imag);
27600 z_theta = theta * b.real + lnr * b.imag;
27601 z.real = z_r * cos(z_theta);
27602 z.imag = z_r * sin(z_theta);
27609 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value) {
27610 const enum NPY_TYPES neg_one = (
enum NPY_TYPES) ((
enum NPY_TYPES) 0 - (
enum NPY_TYPES) 1), const_zero = (
enum NPY_TYPES) 0;
27611 const int is_unsigned = neg_one > const_zero;
27613 if (
sizeof(
enum NPY_TYPES) <
sizeof(long)) {
27614 return PyInt_FromLong((
long) value);
27615 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned long)) {
27616 return PyLong_FromUnsignedLong((
unsigned long) value);
27617 #ifdef HAVE_LONG_LONG 27618 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned PY_LONG_LONG)) {
27619 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27623 if (
sizeof(
enum NPY_TYPES) <=
sizeof(
long)) {
27624 return PyInt_FromLong((
long) value);
27625 #ifdef HAVE_LONG_LONG 27626 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(PY_LONG_LONG)) {
27627 return PyLong_FromLongLong((PY_LONG_LONG) value);
27632 int one = 1;
int little = (int)*(
unsigned char *)&one;
27633 unsigned char *bytes = (
unsigned char *)&value;
27634 return _PyLong_FromByteArray(bytes,
sizeof(
enum NPY_TYPES),
27635 little, !is_unsigned);
27640 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
27641 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
27642 const int is_unsigned = neg_one > const_zero;
27643 #if PY_MAJOR_VERSION < 3 27644 if (likely(PyInt_Check(x))) {
27645 if (
sizeof(
int) <
sizeof(long)) {
27646 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
27648 long val = PyInt_AS_LONG(x);
27649 if (is_unsigned && unlikely(val < 0)) {
27650 goto raise_neg_overflow;
27656 if (likely(PyLong_Check(x))) {
27658 #if CYTHON_USE_PYLONG_INTERNALS 27659 const digit* digits = ((PyLongObject*)x)->ob_digit;
27660 switch (Py_SIZE(x)) {
27661 case 0:
return (
int) 0;
27662 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
27664 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27665 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27666 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27667 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
27668 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27673 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
27674 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27675 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27676 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
27677 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27682 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
27683 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27684 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27685 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
27686 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27692 #if CYTHON_COMPILING_IN_CPYTHON 27693 if (unlikely(Py_SIZE(x) < 0)) {
27694 goto raise_neg_overflow;
27698 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27699 if (unlikely(result < 0))
27701 if (unlikely(result == 1))
27702 goto raise_neg_overflow;
27705 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27706 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
27707 #ifdef HAVE_LONG_LONG 27708 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27709 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27713 #if CYTHON_USE_PYLONG_INTERNALS 27714 const digit* digits = ((PyLongObject*)x)->ob_digit;
27715 switch (Py_SIZE(x)) {
27716 case 0:
return (
int) 0;
27717 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
27718 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
27720 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
27721 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27722 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27723 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27724 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27729 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27730 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27731 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27732 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27733 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27738 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27739 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27740 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27741 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27742 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27747 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
27748 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27749 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27750 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27751 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27756 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27757 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27758 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27759 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
27760 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27765 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
27766 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27767 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27768 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
27769 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27775 if (
sizeof(
int) <=
sizeof(long)) {
27776 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
27777 #ifdef HAVE_LONG_LONG 27778 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
27779 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
27784 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 27785 PyErr_SetString(PyExc_RuntimeError,
27786 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27789 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
27790 #if PY_MAJOR_VERSION < 3 27791 if (likely(v) && !PyLong_Check(v)) {
27793 v = PyNumber_Long(tmp);
27798 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27799 unsigned char *bytes = (
unsigned char *)&val;
27800 int ret = _PyLong_AsByteArray((PyLongObject *)v,
27801 bytes,
sizeof(val),
27802 is_little, !is_unsigned);
27812 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27813 if (!tmp)
return (
int) -1;
27814 val = __Pyx_PyInt_As_int(tmp);
27819 PyErr_SetString(PyExc_OverflowError,
27820 "value too large to convert to int");
27822 raise_neg_overflow:
27823 PyErr_SetString(PyExc_OverflowError,
27824 "can't convert negative value to int");
27829 static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) {
27830 const Py_intptr_t neg_one = (Py_intptr_t) ((Py_intptr_t) 0 - (Py_intptr_t) 1), const_zero = (Py_intptr_t) 0;
27831 const int is_unsigned = neg_one > const_zero;
27832 #if PY_MAJOR_VERSION < 3 27833 if (likely(PyInt_Check(x))) {
27834 if (
sizeof(Py_intptr_t) <
sizeof(long)) {
27835 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, PyInt_AS_LONG(x))
27837 long val = PyInt_AS_LONG(x);
27838 if (is_unsigned && unlikely(val < 0)) {
27839 goto raise_neg_overflow;
27841 return (Py_intptr_t) val;
27845 if (likely(PyLong_Check(x))) {
27847 #if CYTHON_USE_PYLONG_INTERNALS 27848 const digit* digits = ((PyLongObject*)x)->ob_digit;
27849 switch (Py_SIZE(x)) {
27850 case 0:
return (Py_intptr_t) 0;
27851 case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, digits[0])
27853 if (8 *
sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
27854 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27855 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27856 }
else if (8 *
sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT) {
27857 return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
27862 if (8 *
sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
27863 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27864 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27865 }
else if (8 *
sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT) {
27866 return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
27871 if (8 *
sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
27872 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27873 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27874 }
else if (8 *
sizeof(Py_intptr_t) >= 4 * PyLong_SHIFT) {
27875 return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
27881 #if CYTHON_COMPILING_IN_CPYTHON 27882 if (unlikely(Py_SIZE(x) < 0)) {
27883 goto raise_neg_overflow;
27887 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27888 if (unlikely(result < 0))
27889 return (Py_intptr_t) -1;
27890 if (unlikely(result == 1))
27891 goto raise_neg_overflow;
27894 if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned long)) {
27895 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
unsigned long, PyLong_AsUnsignedLong(x))
27896 #ifdef HAVE_LONG_LONG 27897 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned PY_LONG_LONG)) {
27898 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27902 #if CYTHON_USE_PYLONG_INTERNALS 27903 const digit* digits = ((PyLongObject*)x)->ob_digit;
27904 switch (Py_SIZE(x)) {
27905 case 0:
return (Py_intptr_t) 0;
27906 case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, (sdigit) (-(sdigit)digits[0]))
27907 case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, +digits[0])
27909 if (8 *
sizeof(Py_intptr_t) - 1 > 1 * PyLong_SHIFT) {
27910 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27911 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27912 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
27913 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
27918 if (8 *
sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
27919 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27920 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27921 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
27922 return (Py_intptr_t) ((((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
27927 if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
27928 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27929 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27930 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
27931 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
27936 if (8 *
sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
27937 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27938 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27939 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
27940 return (Py_intptr_t) ((((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
27945 if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
27946 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27947 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27948 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
27949 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
27954 if (8 *
sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
27955 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27956 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27957 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
27958 return (Py_intptr_t) ((((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
27964 if (
sizeof(Py_intptr_t) <=
sizeof(long)) {
27965 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
long, PyLong_AsLong(x))
27966 #ifdef HAVE_LONG_LONG 27967 }
else if (
sizeof(Py_intptr_t) <=
sizeof(PY_LONG_LONG)) {
27968 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x))
27973 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 27974 PyErr_SetString(PyExc_RuntimeError,
27975 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27978 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
27979 #if PY_MAJOR_VERSION < 3 27980 if (likely(v) && !PyLong_Check(v)) {
27982 v = PyNumber_Long(tmp);
27987 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27988 unsigned char *bytes = (
unsigned char *)&val;
27989 int ret = _PyLong_AsByteArray((PyLongObject *)v,
27990 bytes,
sizeof(val),
27991 is_little, !is_unsigned);
27997 return (Py_intptr_t) -1;
28001 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28002 if (!tmp)
return (Py_intptr_t) -1;
28003 val = __Pyx_PyInt_As_Py_intptr_t(tmp);
28008 PyErr_SetString(PyExc_OverflowError,
28009 "value too large to convert to Py_intptr_t");
28010 return (Py_intptr_t) -1;
28011 raise_neg_overflow:
28012 PyErr_SetString(PyExc_OverflowError,
28013 "can't convert negative value to Py_intptr_t");
28014 return (Py_intptr_t) -1;
28018 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
28019 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
28020 const int is_unsigned = neg_one > const_zero;
28021 #if PY_MAJOR_VERSION < 3 28022 if (likely(PyInt_Check(x))) {
28023 if (
sizeof(
long) <
sizeof(long)) {
28024 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
28026 long val = PyInt_AS_LONG(x);
28027 if (is_unsigned && unlikely(val < 0)) {
28028 goto raise_neg_overflow;
28034 if (likely(PyLong_Check(x))) {
28036 #if CYTHON_USE_PYLONG_INTERNALS 28037 const digit* digits = ((PyLongObject*)x)->ob_digit;
28038 switch (Py_SIZE(x)) {
28039 case 0:
return (
long) 0;
28040 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
28042 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28043 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28044 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28045 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
28046 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28051 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28052 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28053 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28054 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
28055 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28060 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28061 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28062 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28063 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
28064 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28070 #if CYTHON_COMPILING_IN_CPYTHON 28071 if (unlikely(Py_SIZE(x) < 0)) {
28072 goto raise_neg_overflow;
28076 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28077 if (unlikely(result < 0))
28079 if (unlikely(result == 1))
28080 goto raise_neg_overflow;
28083 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28084 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
28085 #ifdef HAVE_LONG_LONG 28086 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28087 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28091 #if CYTHON_USE_PYLONG_INTERNALS 28092 const digit* digits = ((PyLongObject*)x)->ob_digit;
28093 switch (Py_SIZE(x)) {
28094 case 0:
return (
long) 0;
28095 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
28096 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
28098 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
28099 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28100 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28101 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28102 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28107 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28108 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28109 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28110 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28111 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28116 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28117 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28118 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28119 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28120 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28125 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28126 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28127 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28128 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28129 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28134 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28135 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28136 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28137 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28138 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28143 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28144 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28145 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28146 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28147 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28153 if (
sizeof(
long) <=
sizeof(long)) {
28154 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
28155 #ifdef HAVE_LONG_LONG 28156 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28157 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
28162 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 28163 PyErr_SetString(PyExc_RuntimeError,
28164 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28167 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28168 #if PY_MAJOR_VERSION < 3 28169 if (likely(v) && !PyLong_Check(v)) {
28171 v = PyNumber_Long(tmp);
28176 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28177 unsigned char *bytes = (
unsigned char *)&val;
28178 int ret = _PyLong_AsByteArray((PyLongObject *)v,
28179 bytes,
sizeof(val),
28180 is_little, !is_unsigned);
28190 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28191 if (!tmp)
return (
long) -1;
28192 val = __Pyx_PyInt_As_long(tmp);
28197 PyErr_SetString(PyExc_OverflowError,
28198 "value too large to convert to long");
28200 raise_neg_overflow:
28201 PyErr_SetString(PyExc_OverflowError,
28202 "can't convert negative value to long");
28207 #if CYTHON_COMPILING_IN_CPYTHON 28208 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
28214 return b == &PyBaseObject_Type;
28216 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
28218 if (a == b)
return 1;
28222 n = PyTuple_GET_SIZE(mro);
28223 for (i = 0; i <
n; i++) {
28224 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
28229 return __Pyx_InBases(a, b);
28231 #if PY_MAJOR_VERSION == 2 28232 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
28233 PyObject *exception, *value, *tb;
28235 __Pyx_PyThreadState_declare
28236 __Pyx_PyThreadState_assign
28237 __Pyx_ErrFetch(&exception, &value, &tb);
28238 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
28239 if (unlikely(res == -1)) {
28240 PyErr_WriteUnraisable(err);
28244 res = PyObject_IsSubclass(err, exc_type2);
28245 if (unlikely(res == -1)) {
28246 PyErr_WriteUnraisable(err);
28250 __Pyx_ErrRestore(exception, value, tb);
28254 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
28255 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
28257 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
28262 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
28264 assert(PyExceptionClass_Check(exc_type));
28265 n = PyTuple_GET_SIZE(tuple);
28266 #if PY_MAJOR_VERSION >= 3 28267 for (i=0; i<
n; i++) {
28268 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
28271 for (i=0; i<
n; i++) {
28272 PyObject *t = PyTuple_GET_ITEM(tuple, i);
28273 #if PY_MAJOR_VERSION < 3 28274 if (likely(exc_type == t))
return 1;
28276 if (likely(PyExceptionClass_Check(t))) {
28277 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
28283 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
28284 if (likely(err == exc_type))
return 1;
28285 if (likely(PyExceptionClass_Check(err))) {
28286 if (likely(PyExceptionClass_Check(exc_type))) {
28287 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
28288 }
else if (likely(PyTuple_Check(exc_type))) {
28289 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
28293 return PyErr_GivenExceptionMatches(err, exc_type);
28295 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
28296 assert(PyExceptionClass_Check(exc_type1));
28297 assert(PyExceptionClass_Check(exc_type2));
28298 if (likely(err == exc_type1 || err == exc_type2))
return 1;
28299 if (likely(PyExceptionClass_Check(err))) {
28300 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
28302 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
28307 static int __Pyx_check_binary_version(
void) {
28308 char ctversion[4], rtversion[4];
28309 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28310 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
28311 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
28313 PyOS_snprintf(message,
sizeof(message),
28314 "compiletime version %s of module '%.100s' " 28315 "does not match runtime version %s",
28316 ctversion, __Pyx_MODULE_NAME, rtversion);
28317 return PyErr_WarnEx(NULL, message, 1);
28323 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
28325 #if PY_MAJOR_VERSION < 3 28326 if (t->is_unicode) {
28327 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
28328 }
else if (t->intern) {
28329 *t->p = PyString_InternFromString(t->s);
28331 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
28334 if (t->is_unicode | t->is_str) {
28336 *t->p = PyUnicode_InternFromString(t->s);
28337 }
else if (t->encoding) {
28338 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
28340 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
28343 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
28348 if (PyObject_Hash(*t->p) == -1)
28355 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
28356 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
28358 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
28360 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
28362 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 28363 #if !CYTHON_PEP393_ENABLED 28364 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28366 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
28367 if (!defenc)
return NULL;
28368 defenc_c = PyBytes_AS_STRING(defenc);
28369 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 28371 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
28373 for (c = defenc_c; c < end; c++) {
28374 if ((
unsigned char) (*c) >= 128) {
28375 PyUnicode_AsASCIIString(o);
28381 *length = PyBytes_GET_SIZE(defenc);
28385 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28386 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
28387 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 28388 if (likely(PyUnicode_IS_ASCII(o))) {
28389 *length = PyUnicode_GET_LENGTH(o);
28390 return PyUnicode_AsUTF8(o);
28392 PyUnicode_AsASCIIString(o);
28396 return PyUnicode_AsUTF8AndSize(o, length);
28401 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28402 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 28404 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28405 __Pyx_sys_getdefaultencoding_not_ascii &&
28407 PyUnicode_Check(o)) {
28408 return __Pyx_PyUnicode_AsStringAndSize(o, length);
28411 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) 28412 if (PyByteArray_Check(o)) {
28413 *length = PyByteArray_GET_SIZE(o);
28414 return PyByteArray_AS_STRING(o);
28419 int r = PyBytes_AsStringAndSize(o, &result, length);
28420 if (unlikely(r < 0)) {
28427 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
28428 int is_true = x == Py_True;
28429 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
28430 else return PyObject_IsTrue(x);
28432 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
28434 if (unlikely(!x))
return -1;
28435 retval = __Pyx_PyObject_IsTrue(x);
28439 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
28440 #if PY_MAJOR_VERSION >= 3 28441 if (PyLong_Check(result)) {
28442 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
28443 "__int__ returned non-int (type %.200s). " 28444 "The ability to return an instance of a strict subclass of int " 28445 "is deprecated, and may be removed in a future version of Python.",
28446 Py_TYPE(result)->tp_name)) {
28453 PyErr_Format(PyExc_TypeError,
28454 "__%.4s__ returned non-%.4s (type %.200s)",
28455 type_name, type_name, Py_TYPE(result)->tp_name);
28459 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
28460 #if CYTHON_USE_TYPE_SLOTS 28461 PyNumberMethods *m;
28463 const char *name = NULL;
28464 PyObject *res = NULL;
28465 #if PY_MAJOR_VERSION < 3 28466 if (likely(PyInt_Check(x) || PyLong_Check(x)))
28468 if (likely(PyLong_Check(x)))
28470 return __Pyx_NewRef(x);
28471 #if CYTHON_USE_TYPE_SLOTS 28472 m = Py_TYPE(x)->tp_as_number;
28473 #if PY_MAJOR_VERSION < 3 28474 if (m && m->nb_int) {
28476 res = m->nb_int(x);
28478 else if (m && m->nb_long) {
28480 res = m->nb_long(x);
28483 if (likely(m && m->nb_int)) {
28485 res = m->nb_int(x);
28489 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
28490 res = PyNumber_Int(x);
28494 #if PY_MAJOR_VERSION < 3 28495 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
28497 if (unlikely(!PyLong_CheckExact(res))) {
28499 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
28502 else if (!PyErr_Occurred()) {
28503 PyErr_SetString(PyExc_TypeError,
28504 "an integer is required");
28508 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
28511 #if PY_MAJOR_VERSION < 3 28512 if (likely(PyInt_CheckExact(b))) {
28513 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
28514 return PyInt_AS_LONG(b);
28516 return PyInt_AsSsize_t(b);
28519 if (likely(PyLong_CheckExact(b))) {
28520 #if CYTHON_USE_PYLONG_INTERNALS 28521 const digit* digits = ((PyLongObject*)b)->ob_digit;
28522 const Py_ssize_t size = Py_SIZE(b);
28523 if (likely(__Pyx_sst_abs(size) <= 1)) {
28524 ival = likely(size) ? digits[0] : 0;
28525 if (size == -1) ival = -ival;
28530 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28531 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28535 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28536 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28540 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28541 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28545 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28546 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28550 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28551 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28555 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28556 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28562 return PyLong_AsSsize_t(b);
28564 x = PyNumber_Index(b);
28566 ival = PyInt_AsSsize_t(x);
28570 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
28571 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
28573 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
28574 return PyInt_FromSize_t(ival);